You are correct that sound waves cannot travel through the vacuum of space because they require a medium, such as air or water, to propagate. Therefore, the sounds generated by rovers on Mars cannot be directly transmitted to Earth as sound waves. Instead, the sounds captured by the rovers are converted into digital data and transmitted back to Earth through radio waves.
When a rover records sound on Mars, it uses a microphone or other sensing equipment to convert the sound waves into electrical signals. These signals are then converted into digital data, which can be encoded and transmitted as radio signals. The rovers communicate with orbiters around Mars, such as NASA's Mars Reconnaissance Orbiter or the European Space Agency's ExoMars Trace Gas Orbiter, which act as relays. These orbiters receive the data from the rovers and transmit it back to Earth using radio signals.
On Earth, the radio signals are received by large antennas at deep space communication facilities, such as NASA's Deep Space Network (DSN). The received signals are then decoded, processed, and converted back into audio signals, allowing scientists and engineers to listen to the recorded sounds from Mars.
It's important to note that the sounds captured on Mars are often very faint due to the thin atmosphere, and the recording devices are primarily designed to capture scientific data rather than high-fidelity sound. The resulting audio may be enhanced or adjusted to make it more perceptible and understandable to human ears.