audio.h File Reference
Functions for audio driver output.
More...
Detailed Description
Functions for audio driver output.
Typedef Documentation
typedef int(* fluid_audio_func_t)(void *data, int len, int nin, float **in, int nout, float **out) |
Callback function type used with new_fluid_audio_driver2() to allow for custom user audio processing before the audio is sent to the driver.
This function is responsible for rendering the audio to the buffers.
- Parameters:
-
| data | The user data parameter as passed to new_fluid_audio_driver2(). - Parameters:
-
| len | Length of the audio in frames. - Parameters:
-
| nin | Count of buffers in 'in' - Parameters:
-
| in | Not used currently - Parameters:
-
| nout | Count of arrays in 'out' (i.e., channel count) - Parameters:
-
| out | Output buffers, one for each channel - Returns:
- Should return 0 on success, non-zero if an error occured.
|
|
|
|
|
|
Function Documentation
Create a new audio driver.
- Parameters:
-
| settings | Configuration settings used to select and create the audio driver. - Parameters:
-
| synth | Synthesizer instance for which the audio driver is created for. - Returns:
- The new audio driver instance.
Creates a new audio driver for a given 'synth' instance with a defined set of configuration 'settings'. |
|
- Examples:
- example.c, fluidsynth_arpeggio.c, fluidsynth_metronome.c, and fluidsynth_simple.c.
Create a new audio driver.
- Parameters:
-
| settings | Configuration settings used to select and create the audio driver. - Parameters:
-
| func | Function called to fill audio buffers for audio playback - Parameters:
-
| data | User defined data pointer to pass to 'func' - Returns:
- The new audio driver instance.
Like new_fluid_audio_driver() but allows for custom audio processing before audio is sent to audio driver. It is the responsibility of the callback 'func' to render the audio into the buffers. |
NOTE: Not as efficient as new_fluid_audio_driver(). |
|
- Examples:
- fluidsynth_fx.c.
Create a new file renderer and open the file.
- Parameters:
-
| synth | The synth that creates audio data. - Returns:
- the new object, or NULL on failure
- Since:
- 1.1.0
NOTE: Available file types and formats depends on if libfluidsynth was built with libsndfile support or not. If not then only RAW 16 bit output is supported. |
Uses the following settings from the synth object:
- audio.file.name: Output filename
- audio.file.type: File type, "auto" tries to determine type from filename extension with fallback to "wav".
- audio.file.format: Audio format
- audio.file.endian: Endian byte order, "auto" for file type's default byte order
- audio.period-size: Size of audio blocks to process
- synth.sample-rate: Sample rate to use
Write period_size samples to file.
- Parameters:
-
Close file and destroy a file renderer object.
- Parameters:
-
| dev | File renderer object. - Since:
- 1.1.0
|