template<
size_t transfer_size>
class daisy::WavWriter< transfer_size >
Audio Recording Module
Record audio into a working buffer that is gradually written to a WAV file on an SD Card.
Recordings are made with floating point input, and will be converted to the specified bits per sample internally
For now only 16-bit and 32-bit (signed int) formats are supported f32 and s24 formats will be added next
The transfer size determines the amount of internal memory used, and can have an effect on the performance of the streaming behavior of the WavWriter. Memory use can be calculated as: (2 * transfer_size) bytes Performance optimal with sizes: 16384, 32768
To use:
- Create a WavWriter<size> object (e.g. WavWriter<32768> writer)
- Configure the settings as desired by creating a WavWriter<32768>::Config struct and setting the settings.
- Initialize the object with the configuration struct.
- Open a new file for writing with: writer.OpenFile("FileName.wav")
- Write to it within your audio callback using: writer.Sample(value)
- Fill the Wav File on the SD Card with data from your main loop by running: writer.Write()
- When finished with the recording finalize, and close the file with: writer.SaveFile();