![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
Utility function for reading WAV audio files. More...
Go to the source code of this file.
Data Structures | |
| struct | lf_waveform_t |
| Waveform in 16-bit linear-PCM format. More... | |
Typedefs | |
| typedef struct lf_waveform_t | lf_waveform_t |
| Waveform in 16-bit linear-PCM format. | |
Functions | |
| lf_waveform_t * | read_wave_file (const char *path) |
| Open a wave file, check that the format is supported, allocate memory for the sample data, and fill the memory with the sample data. | |
Utility function for reading WAV audio files.
This defines functions and data types for importing audio files with the wave audio format. The main function is read_wave_file(), which, given a path to a .wav file, reads the file and, if the format of the file is supported, returns an lf_waveform_t struct, which contains the raw audio data in 16-bit linear PCM form.
This code has few dependencies, so it should run on just about any platform.
To use this, include the following flags in your target properties:
In addition, you need this in your Lingua Franca file or reactor: