AudioStream: Re-add SDL backend
This commit is contained in:
@ -365,6 +365,11 @@ std::unique_ptr<AudioStream> Host::CreateAudioStream(AudioBackend backend, u32 s
|
||||
return AudioStream::CreateCubebAudioStream(sample_rate, channels, buffer_ms, latency_ms, stretch);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SDL2
|
||||
case AudioBackend::SDL:
|
||||
return AudioStream::CreateSDLAudioStream(sample_rate, channels, buffer_ms, latency_ms, stretch);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
case AudioBackend::XAudio2:
|
||||
return AudioStream::CreateXAudio2Stream(sample_rate, channels, buffer_ms, latency_ms, stretch);
|
||||
|
||||
@ -1559,6 +1559,9 @@ static constexpr const std::array s_audio_backend_names = {
|
||||
#ifdef ENABLE_CUBEB
|
||||
"Cubeb",
|
||||
#endif
|
||||
#ifdef ENABLE_SDL2
|
||||
"SDL",
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
"XAudio2",
|
||||
#endif
|
||||
@ -1571,6 +1574,9 @@ static constexpr const std::array s_audio_backend_display_names = {
|
||||
#ifdef ENABLE_CUBEB
|
||||
TRANSLATE_NOOP("AudioBackend", "Cubeb"),
|
||||
#endif
|
||||
#ifdef ENABLE_SDL2
|
||||
TRANSLATE_NOOP("AudioBackend", "SDL"),
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
TRANSLATE_NOOP("AudioBackend", "XAudio2"),
|
||||
#endif
|
||||
|
||||
@ -484,6 +484,8 @@ struct Settings
|
||||
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::XAudio2;
|
||||
#elif defined(__ANDROID__)
|
||||
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::AAudio;
|
||||
#elif defined(ENABLE_SDL2)
|
||||
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::SDL;
|
||||
#else
|
||||
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Null;
|
||||
#endif
|
||||
|
||||
@ -190,6 +190,9 @@ enum class AudioBackend : u8
|
||||
#ifdef ENABLE_CUBEB
|
||||
Cubeb,
|
||||
#endif
|
||||
#ifdef ENABLE_SDL2
|
||||
SDL,
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
XAudio2,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user