diff options
| author | Mat M <mathew1800@gmail.com> | 2017-05-27 21:39:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-27 21:39:03 -0400 |
| commit | 905232fd2b0f0545e524c4c34859bf62576e43f5 (patch) | |
| tree | 88d01f6fe28d6c1312eb19c68693aa3d728f66bf /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | d4faa099d95edcc408d90fefb601999b1481d308 (diff) | |
| parent | d416cbd9ed5efb391ad65c36ded74c17ab713622 (diff) | |
Merge pull request #5313 from ligfx/addcubeb
Add CubebStream output backend and replace PortAudio for microphones
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index fea933e582..6fc5a70c84 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -5,6 +5,7 @@ #include "AudioCommon/AudioCommon.h" #include "AudioCommon/AlsaSoundStream.h" #include "AudioCommon/CoreAudioSoundStream.h" +#include "AudioCommon/CubebStream.h" #include "AudioCommon/Mixer.h" #include "AudioCommon/NullSoundStream.h" #include "AudioCommon/OpenALStream.h" @@ -30,7 +31,9 @@ static const int AUDIO_VOLUME_MAX = 100; void InitSoundStream() { std::string backend = SConfig::GetInstance().sBackend; - if (backend == BACKEND_OPENAL && OpenALStream::isValid()) + if (backend == BACKEND_CUBEB) + g_sound_stream = std::make_unique<CubebStream>(); + else if (backend == BACKEND_OPENAL && OpenALStream::isValid()) g_sound_stream = std::make_unique<OpenALStream>(); else if (backend == BACKEND_NULLSOUND) g_sound_stream = std::make_unique<NullSound>(); @@ -110,6 +113,7 @@ std::vector<std::string> GetSoundBackends() std::vector<std::string> backends; backends.push_back(BACKEND_NULLSOUND); + backends.push_back(BACKEND_CUBEB); if (XAudio2_7::isValid() || XAudio2::isValid()) backends.push_back(BACKEND_XAUDIO2); if (AlsaSound::isValid()) @@ -131,6 +135,8 @@ bool SupportsDPL2Decoder(const std::string& backend) if (backend == BACKEND_OPENAL) return true; #endif + if (backend == BACKEND_CUBEB) + return true; if (backend == BACKEND_PULSEAUDIO) return true; return false; @@ -146,7 +152,8 @@ bool SupportsVolumeChanges(const std::string& backend) // FIXME: this one should ask the backend whether it supports it. // but getting the backend from string etc. is probably // too much just to enable/disable a stupid slider... - return backend == BACKEND_COREAUDIO || backend == BACKEND_OPENAL || backend == BACKEND_XAUDIO2; + return backend == BACKEND_COREAUDIO || backend == BACKEND_CUBEB || backend == BACKEND_OPENAL || + backend == BACKEND_XAUDIO2; } void UpdateSoundStream() |
