| Top |
| struct audio_signal * | audio_signal_init () |
| int | audio_signal_add_frequency () |
| void | audio_signal_synthesize () |
| void | audio_signal_clean () |
| void | audio_signal_fill () |
| bool | audio_signal_detect () |
This library contains helpers for audio-related tests. More specifically, it allows generating additions of sine signals as well as detecting them.
struct audio_signal * audio_signal_init (int channels,int sampling_rate);
Allocate and initialize an audio signal structure with the given parameters.
int audio_signal_add_frequency (struct audio_signal *signal,int frequency);
Add a frequency to the signal.
void
audio_signal_synthesize (struct audio_signal *signal);
Free the resources allocated by audio_signal_synthesize and remove the previously-added frequencies.
void audio_signal_fill (struct audio_signal *signal,short *buffer,int frames);
Fill the requested number of frames to the target buffer with the audio signal data (in interleaved S16_LE format), at the requested sampling rate and number of channels.
bool audio_signal_detect (struct audio_signal *signal,int channels,int sampling_rate,short *buffer,int frames);
Detect that the frequencies specified in signal
, and only those, are
present in the input data. The input data's format is required to be S16_LE.