examples/csv2wav/README.md
This project provides a utility to convert audio data recorded via Serial Studio’s Audio I/O driver into playable WAV files. It’s designed for developers testing Serial Studio’s data pipeline integrity using audio signals, such as voice, tones, or music. If the reconstructed .wav file sounds like the original, the I/O pipeline is functioning as expected.
This tool requires no additional hardware. Just Serial Studio, a microphone or audio source, and this Python script.
Note: Serial Studio’s audio features may require a paid license. Visit serial-studio.com for more details.
Serial Studio logs audio samples to CSV using the following structure:
RX Date/Time,Audio Input/Channel 1,Audio Input/Channel 2,...
2025/08/02 23:43:57::950,0.000000,0.002541,...
.wav filefloat32, int16, int24, int32, uint8).csv filepython3 csv2wav.py path/to/audio.csv
Optional: specify output path, custom sample rate, and format
python3 csv2wav.py path/to/audio.csv output.wav --rate 48000 --format int16
| Format | Bit Depth | Range |
|---|---|---|
| float32 | 32-bit | -1.0 to 1.0 |
| int16 | 16-bit | -32768 to 32767 |
| int24 | 24-bit | -8388608 to 8388607 |
| int32 | 32-bit | -2147483648 to 2147483647 |
| uint8 | 8-bit | 0 to 255 (biased unsigned) |
Default format is float32. For playback compatibility, int16 is usually a safe bet.
As a developer or tester:
csv2wav.py to convert it back into a WAVcsv2wav.py: The core CSV to WAV conversion scriptREADME.md: Project documentation and usage guidenumpy (install via pip)pip install numpy
python3 csv2wav.py input.csv [output.wav] [--rate <hz>] [--in_format <type>]
input.csv: CSV file exported from Serial Studiooutput.wav: Optional name for output WAV file--rate: Optional sample rate in Hz (default: 44100)--in_format: Input format (float32, int16, int24, int32, uint8)[!TIP]
For advanced resampling, route audio through a virtual loopback device and set the target frequency with Serial Studio. Then runcsv2wav.pyto export at the new frequency. This trick often delivers some of the cleanest downsampling results you'll hear, perfect for a slowed & reverb style mixes.