Android: Add OpenSL ES audio backend

This commit is contained in:
Connor McLaughlin
2020-10-13 23:11:28 +10:00
parent 82f00237af
commit 962f3407b4
10 changed files with 290 additions and 7 deletions

View File

@ -592,10 +592,24 @@ float Settings::GetDisplayAspectRatioValue(DisplayAspectRatio ar)
return s_display_aspect_ratio_values[static_cast<int>(ar)];
}
static std::array<const char*, 3> s_audio_backend_names = {{"Null", "Cubeb", "SDL"}};
static std::array<const char*, 3> s_audio_backend_display_names = {{TRANSLATABLE("AudioBackend", "Null (No Output)"),
TRANSLATABLE("AudioBackend", "Cubeb"),
TRANSLATABLE("AudioBackend", "SDL")}};
static std::array<const char*, 3> s_audio_backend_names = {{
"Null",
"Cubeb",
#ifndef ANDROID
"SDL",
#else
"OpenSLES",
#endif
}};
static std::array<const char*, 3> s_audio_backend_display_names = {{
TRANSLATABLE("AudioBackend", "Null (No Output)"),
TRANSLATABLE("AudioBackend", "Cubeb"),
#ifndef ANDROID
TRANSLATABLE("AudioBackend", "SDL"),
#else
TRANSLATABLE("AudioBackend", "OpenSL ES"),
#endif
}};
std::optional<AudioBackend> Settings::ParseAudioBackend(const char* str)
{

View File

@ -251,8 +251,15 @@ struct Settings
#endif
static constexpr GPUTextureFilter DEFAULT_GPU_TEXTURE_FILTER = GPUTextureFilter::Nearest;
static constexpr ConsoleRegion DEFAULT_CONSOLE_REGION = ConsoleRegion::Auto;
static constexpr CPUExecutionMode DEFAULT_CPU_EXECUTION_MODE = CPUExecutionMode::Recompiler;
#ifndef ANDROID
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Cubeb;
#else
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::OpenSLES;
#endif
static constexpr DisplayCropMode DEFAULT_DISPLAY_CROP_MODE = DisplayCropMode::Overscan;
static constexpr DisplayAspectRatio DEFAULT_DISPLAY_ASPECT_RATIO = DisplayAspectRatio::R4_3;
static constexpr ControllerType DEFAULT_CONTROLLER_1_TYPE = ControllerType::DigitalController;

View File

@ -97,7 +97,11 @@ enum class AudioBackend : u8
{
Null,
Cubeb,
#ifndef ANDROID
SDL,
#else
OpenSLES,
#endif
Count
};