include/SDL_hints.h
changeset 10849 bc671e6906ae
parent 10812 a2d6288be599
child 10852 494d0f56ae7a
     1.1 --- a/include/SDL_hints.h	Tue Jan 24 12:20:41 2017 -0500
     1.2 +++ b/include/SDL_hints.h	Tue Jan 24 15:52:22 2017 -0500
     1.3 @@ -776,6 +776,42 @@
     1.4  #define SDL_HINT_OPENGL_ES_DRIVER   "SDL_OPENGL_ES_DRIVER"
     1.5  
     1.6  /**
     1.7 + *  \brief  A variable controlling speed/quality tradeoff of audio resampling.
     1.8 + *
     1.9 + *  If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
    1.10 + *  to handle audio resampling. There are different resampling modes available
    1.11 + *  that produce different levels of quality, possibly using more CPU.
    1.12 + *
    1.13 + *  If this hint isn't specified to a valid setting, or libsamplerate isn't
    1.14 + *  available, SDL will act as if this hint was set to "fast".
    1.15 + *
    1.16 + *  Note that this is currently only applicable to resampling audio that is
    1.17 + *  being written to a device for playback or audio being read from a device
    1.18 + *  for capture. SDL_AudioCVT always uses the "fast" resampler (although this
    1.19 + *  might change for SDL 2.1).
    1.20 + *
    1.21 + *  Most things can probably live with the "fast" resampler, but if quality
    1.22 + *  is important or you can spare some CPU cycles, the other options are
    1.23 + *  worth exploring!
    1.24 + *
    1.25 + *  libsamplerate's interpolators, that these hints map to, are explained here:
    1.26 + *     http://www.mega-nerd.com/SRC/api_misc.html#Converters
    1.27 + *
    1.28 + *  This hint is only checked at audio subsystem init time and changes to it
    1.29 + *  at other times are ignored.
    1.30 + *
    1.31 + *  This variable can be set to the following values:
    1.32 + *
    1.33 + *    "default"  - Use SDL's internal, resampler. (Default when not set. low quality, fast.)
    1.34 + *    "linear" - Use libsamplerate's Linear interpolator (low quality, fast).
    1.35 + *    "zero_order_hold" - Use libsamplerate's Zero Order Hold interpolator (low quality, fast).
    1.36 + *    "sinc_fastest" - Use libsamplerate's fastest (lowest quality) sinc interpolator.
    1.37 + *    "sinc_medium" - Use libsamplerate's medium quality sinc interpolator.
    1.38 + *    "sinc_best" - Use libsamplerate's best quality sinc interpolator.
    1.39 + */
    1.40 +#define SDL_HINT_AUDIO_RESAMPLER_MODE   "SDL_AUDIO_RESAMPLER_MODE"
    1.41 +
    1.42 +/**
    1.43   *  \brief  An enumeration of hint priorities
    1.44   */
    1.45  typedef enum