Add deprecation attribute to fluid_synth_set_sample_rate()

This commit is contained in:
derselbst 2019-11-03 10:55:29 +01:00
parent 405d4bc48b
commit 60bcdd4457
2 changed files with 2 additions and 2 deletions

View file

@ -176,7 +176,7 @@ FLUIDSYNTH_API int fluid_synth_count_effects_groups(fluid_synth_t *synth);
/* Synthesis parameters */
FLUIDSYNTH_API void fluid_synth_set_sample_rate(fluid_synth_t *synth, float sample_rate);
FLUID_DEPRECATED FLUIDSYNTH_API void fluid_synth_set_sample_rate(fluid_synth_t *synth, float sample_rate);
FLUIDSYNTH_API void fluid_synth_set_gain(fluid_synth_t *synth, float gain);
FLUIDSYNTH_API float fluid_synth_get_gain(fluid_synth_t *synth);
FLUIDSYNTH_API int fluid_synth_set_polyphony(fluid_synth_t *synth, int polyphony);

View file

@ -3068,7 +3068,7 @@ fluid_synth_handle_sample_rate(void *data, const char *name, double value)
* @deprecated As of fluidsynth 2.1.0 this function has been deprecated.
* Changing the sample-rate is generally not considered to be a real-time use-case, as it always produces some audible artifact ("click", "pop") on the dry sound and effects (because LFOs for chorus and reverb need to be reinitialized).
* The sample-rate change may also require memory allocation deep down in the effect units.
* However, this memory allocation may fail, but there is no way for the caller to know that, because the actual change of the sample-rate is executed during rendering.
* However, this memory allocation may fail and there is no way for the caller to know that, because the actual change of the sample-rate is executed during rendering.
* This function cannot (must not) do the sample-rate change itself, otherwise the synth needs to be locked down, causing rendering to block.
* Esp. do not use this function if this @p synth instance is used by an audio driver, because the audio driver cannot be notified by this sample-rate change.
* Long story short: don't use it.