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. For details
46 * please refer to fluid_synth_process().
47 * @param data The user data parameter as passed to new_fluid_audio_driver2().
48 * @param len Count of audio frames to synthesize.
49 * @param nfx Count of arrays in \c fx.
50 * @param fx Array of buffers to store effects audio to. Buffers may alias with buffers of \c out.
51 * @param nout Count of arrays in \c out.
52 * @param out Array of buffers to store (dry) audio to. Buffers may alias with buffers of \c fx.
53 * @return Should return #FLUID_OK on success, #FLUID_FAILED if an error occured.
55 typedef int (*fluid_audio_func_t
)(void *data
, int len
,
57 int nout
, float *out
[]);
59 FLUIDSYNTH_API fluid_audio_driver_t
*new_fluid_audio_driver(fluid_settings_t
*settings
,
60 fluid_synth_t
*synth
);
62 FLUIDSYNTH_API fluid_audio_driver_t
*new_fluid_audio_driver2(fluid_settings_t
*settings
,
63 fluid_audio_func_t func
,
66 FLUIDSYNTH_API
void delete_fluid_audio_driver(fluid_audio_driver_t
*driver
);
68 FLUIDSYNTH_API fluid_file_renderer_t
*new_fluid_file_renderer(fluid_synth_t
*synth
);
69 FLUIDSYNTH_API
int fluid_file_renderer_process_block(fluid_file_renderer_t
*dev
);
70 FLUIDSYNTH_API
void delete_fluid_file_renderer(fluid_file_renderer_t
*dev
);
71 FLUIDSYNTH_API
int fluid_file_set_encoding_quality(fluid_file_renderer_t
*dev
, double q
);
73 FLUIDSYNTH_API
int fluid_audio_driver_register(const char **adrivers
);
79 #endif /* _FLUIDSYNTH_AUDIO_H */