|
Chrispy
High-performance multichannel ADC sampling and audio recording.
|
Functions | |
| bool | init (uint8_t nchannels, adc::Channel *channels, SdFat *sd) |
| Initialize recorder with these fields. | |
| int64_t | record (const char *filenames[], BitResolution res, uint32_t sample_rate, uint32_t duration_ms, uint8_t *buf, size_t sz) |
Uses the SD singleton to record to every file in files with the same sample rate and duration. | |
| bool recording::init | ( | uint8_t | nchannels, |
| adc::Channel * | channels, | ||
| SdFat * | sd | ||
| ) |
Initialize recorder with these fields.
| nchannels | Number of channels to expect in mic_pins and power_pins. |
| channels | Array of channels to record on. |
| sd | SD card to use for recording. |
| int64_t recording::record | ( | const char * | filenames[], |
| BitResolution | res, | ||
| uint32_t | sample_rate, | ||
| uint32_t | duration_ms, | ||
| uint8_t * | buf, | ||
| size_t | sz | ||
| ) |
Uses the SD singleton to record to every file in files with the same sample rate and duration.
Truncates all files to be equal to the shortest lengths.
Invariants:
files is of at least channels length and contains valid filenames.| filenames | Array of filenames to record to. Must be at least as long as nchannels. |
| res | Bit resolution to record at. |
| sample_rate | Requested sample rate for each channel. |
| duration_ms | Length in milliseconds to record for. |
| buf | Buffer allocated to receive ADC samples. |
| sz | Buffer size. |
| adc::Channel* recording::channels |
| bool recording::initialized = false |
| uint8_t recording::nchannels |
| SdFat* recording::sd |