|
96 | 96 | <li>pulseaudio: PulseAudio (Linux, Mac OS X, Windows)</li> |
97 | 97 | <li>coreaudio: Apple CoreAudio (Mac OS X)</li> |
98 | 98 | <li>dsound: Microsoft DirectSound (Windows)</li> |
| 99 | +<li>wasapi: Windows Audio Session API (Windows Vista and later)</li> |
| 100 | +<li>waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86, Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP and later)</li> |
99 | 101 | <li>portaudio: PortAudio Library (Mac OS 9 & X, Windows, Linux)</li> |
100 | 102 | <li>sndman: Apple SoundManager (Mac OS Classic)</li> |
101 | 103 | <li>dart: DART sound driver (OS/2)</li> |
102 | 104 | <li>opensles: OpenSL ES (Android)</li> |
103 | 105 | <li>oboe: Oboe (Android)</li> |
104 | | -<li>waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86, Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP and later)</li> |
105 | | -<li>file: Driver to output audio to a file</li> |
106 | 106 | <li>sdl3*: Simple DirectMedia Layer (Linux, Windows, Mac OS X, iOS, Android, FreeBSD, Haiku, etc.)</li> |
107 | 107 | <li>pipewire**: PipeWire (Linux)</li> |
| 108 | +<li>file: Driver to output audio to a file</li> |
108 | 109 | </ul> |
109 | 110 | <p>The default audio driver depends on the settings with which FluidSynth was compiled. You can get the default driver with <a class="el" href="group__settings.html#ga5acb5b788aae89b556dd69f2f6d667eb" title="Get the default value of a string setting.">fluid_settings_getstr_default()</a>. To get the list of available drivers use the <a class="el" href="group__settings.html#ga27b468f705be56657281b07fbe4e0398" title="Iterate the available options for a named string setting, calling the provided callback function for ...">fluid_settings_foreach_option()</a> function. Finally, you can set the driver with <a class="el" href="group__settings.html#ga58cbabbb8990c2934b3eeea925e01804" title="Set a string value for a named setting.">fluid_settings_setstr()</a>. In most cases, the default driver should work out of the box.</p> |
110 | | -<p>Additional options that define the audio quality and latency are <a class="el" href="settings_audio.html#settings_audio_sample-format">audio.sample-format</a>, <a class="el" href="settings_audio.html#settings_audio_period-size">audio.period-size</a>, and <a class="el" href="settings_audio.html#settings_audio_periods">audio.periods</a>. The details are described later.</p> |
111 | | -<p>You create the audio driver with the <a class="el" href="group__audio__driver.html#ga7c66ef86f0008807bdd955770fca6925" title="Create a new audio driver.">new_fluid_audio_driver()</a> function. This function takes the settings and synthesizer object as arguments. For example:</p> |
| 111 | +<p>Additional audio driver options that define the audio quality and latency include <a class="el" href="settings_audio.html#settings_audio_sample-format">audio.sample-format</a>, <a class="el" href="settings_audio.html#settings_audio_period-size">audio.period-size</a>, and <a class="el" href="settings_audio.html#settings_audio_periods">audio.periods</a>. The synthesizer's settings_synth.sample-rate is also involved. The details are described later.</p> |
| 112 | +<p>Important: Configure the synthesizer before creating the audio driver. In particular, set settings_synth.sample-rate before instantiating the synth with <a class="el" href="group__synth.html#ga2aab8e0b82dc9fd086849efacb3c1b1b" title="Create new FluidSynth instance.">new_fluid_synth()</a>. After the synth has been created, changing settings_synth.sample-rate in the settings object may not change the sample rate used by the synthesizer, while audio drivers created later may use the updated setting value and cause the audio to be played out of tune. If you need to change the sample rate, recreate both the synthesizer and the audio driver using settings with the new sample rate.</p> |
| 113 | +<p>You can create the audio driver with the <a class="el" href="group__audio__driver.html#ga7c66ef86f0008807bdd955770fca6925" title="Create a new audio driver.">new_fluid_audio_driver()</a> function. This function takes the settings and synthesizer object as arguments. For example:</p> |
112 | 114 | <div class="fragment"><div class="line"><span class="keywordtype">void</span> init() </div> |
113 | 115 | <div class="line">{</div> |
114 | 116 | <div class="line"> <a class="code" href="group__Types.html#gaa363402d3c77333b0f070ba531d034ba">fluid_settings_t</a>* settings;</div> |
|
129 | 131 | <div class="ttc" id="agroup__settings_html_ga58cbabbb8990c2934b3eeea925e01804"><div class="ttname"><a href="group__settings.html#ga58cbabbb8990c2934b3eeea925e01804">fluid_settings_setstr</a></div><div class="ttdeci">int fluid_settings_setstr(fluid_settings_t *settings, const char *name, const char *str)</div><div class="ttdoc">Set a string value for a named setting.</div><div class="ttdef"><b>Definition:</b> fluid_settings.c:962</div></div> |
130 | 132 | <div class="ttc" id="agroup__settings_html_ga7623af35fb3d1abace21ef7d5b4f4781"><div class="ttname"><a href="group__settings.html#ga7623af35fb3d1abace21ef7d5b4f4781">new_fluid_settings</a></div><div class="ttdeci">fluid_settings_t * new_fluid_settings(void)</div><div class="ttdoc">Create a new settings object.</div><div class="ttdef"><b>Definition:</b> fluid_settings.c:261</div></div> |
131 | 133 | <div class="ttc" id="agroup__synth_html_ga2aab8e0b82dc9fd086849efacb3c1b1b"><div class="ttname"><a href="group__synth.html#ga2aab8e0b82dc9fd086849efacb3c1b1b">new_fluid_synth</a></div><div class="ttdeci">fluid_synth_t * new_fluid_synth(fluid_settings_t *settings)</div><div class="ttdoc">Create new FluidSynth instance.</div><div class="ttdef"><b>Definition:</b> fluid_synth.c:671</div></div> |
132 | | -</div><!-- fragment --><p>As soon as the audio driver is created, it will start playing. The audio driver creates a separate thread that uses the synthesizer object to generate the audio.</p> |
| 134 | +</div><!-- fragment --><p>As soon as the audio driver is created, it will start playing. The audio driver creates a separate thread that receives audio samples from the synthesizer object and transfers them to an audio endpoint to generate sound.</p> |
133 | 135 | <p>There are a number of general audio driver settings. The audio.driver settings define the audio subsystem that will be used. The <a class="el" href="settings_audio.html#settings_audio_periods">audio.periods</a> and <a class="el" href="settings_audio.html#settings_audio_period-size">audio.period-size</a> settings define the latency and robustness against scheduling delays. There are additional settings for the audio subsystems used. For a full list of available <b>audio driver settings</b>, please refer to the <a class="el" href="settings_audio.html">Audio driver settings</a> documentation.</p> |
134 | 136 | <p><b>*Note:</b> In order to use sdl3 as audio driver, the application is responsible for initializing SDL (e.g. with SDL_Init()). This must be done <b>before</b> the first call to <code><a class="el" href="group__settings.html#ga7623af35fb3d1abace21ef7d5b4f4781" title="Create a new settings object.">new_fluid_settings()</a></code>! Also make sure to call SDL_Quit() after all fluidsynth instances have been destroyed. A warning may be printed if sdl3 is available, but no such call has been made.</p> |
135 | 137 | <p><b>**Note:</b> In order to use pipeiwre as audio driver, the application is responsible for initializing PipeWire (e.g. with pw_init()). This must be done <b>before</b> the first call to <code><a class="el" href="group__settings.html#ga7623af35fb3d1abace21ef7d5b4f4781" title="Create a new settings object.">new_fluid_settings()</a></code>! Also make sure to call pw_deinit() after all fluidsynth instances have been destroyed.</p> |
|
0 commit comments