1 /* FluidSynth - A Software Synthesizer
3 * Copyright (C) 2003 Peter Hanappe and others.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef _FLUIDSYNTH_AUDIO_H
22 #define _FLUIDSYNTH_AUDIO_H
30 * @brief Functions for audio driver output.
31 * @defgroup AudioFunctions Functions for audio output
33 * Defines functions for creating audio driver output. Use
34 * new_fluid_audio_driver() to create a new audio driver for a given synth
35 * and configuration settings. The function new_fluid_audio_driver2() can be
36 * used if custom audio processing is desired before the audio is sent to the
37 * audio driver (although it is not as efficient).
39 * @sa @ref CreatingAudioDriver
43 * Callback function type used with new_fluid_audio_driver2() to allow for
44 * custom user audio processing before the audio is sent to the driver. This
45 * function is responsible for rendering the audio to the buffers.
46 * @param data The user data parameter as passed to new_fluid_audio_driver2().
47 * @param len Length of the audio in frames.
48 * @param nin Count of buffers in 'in'
49 * @param in Not used currently
50 * @param nout Count of arrays in 'out' (i.e., channel count)
51 * @param out Output buffers, one for each channel
52 * @return Should return 0 on success, non-zero if an error occured.
54 typedef int (*fluid_audio_func_t
)(void* data
, int len
,
56 int nout
, float** out
);
58 FLUIDSYNTH_API fluid_audio_driver_t
* new_fluid_audio_driver(fluid_settings_t
* settings
,
59 fluid_synth_t
* synth
);
61 FLUIDSYNTH_API fluid_audio_driver_t
* new_fluid_audio_driver2(fluid_settings_t
* settings
,
62 fluid_audio_func_t func
,
65 FLUIDSYNTH_API
void delete_fluid_audio_driver(fluid_audio_driver_t
* driver
);
67 FLUIDSYNTH_API fluid_file_renderer_t
*new_fluid_file_renderer(fluid_synth_t
* synth
);
68 FLUIDSYNTH_API
int fluid_file_renderer_process_block(fluid_file_renderer_t
* dev
);
69 FLUIDSYNTH_API
void delete_fluid_file_renderer(fluid_file_renderer_t
* dev
);
70 FLUIDSYNTH_API
int fluid_file_set_encoding_quality(fluid_file_renderer_t
* dev
, double q
);
76 #endif /* _FLUIDSYNTH_AUDIO_H */