mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Android: Add emulated Wii Speak
This commit is contained in:
@ -23,6 +23,10 @@
|
||||
#include <Objbase.h>
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include "jni/AndroidCommon/IDCache.h"
|
||||
#endif
|
||||
|
||||
namespace IOS::HLE::USB
|
||||
{
|
||||
Microphone::Microphone(const WiiSpeakState& sampler) : m_sampler(sampler)
|
||||
@ -122,6 +126,20 @@ void Microphone::StreamStart()
|
||||
return;
|
||||
m_work_queue.PushBlocking([this] {
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
JNIEnv* env = IDCache::GetEnvForThread();
|
||||
if (jboolean result = env->CallStaticBooleanMethod(
|
||||
IDCache::GetPermissionHandlerClass(),
|
||||
IDCache::GetPermissionHandlerHasRecordAudioPermission(), nullptr);
|
||||
result == JNI_FALSE)
|
||||
{
|
||||
env->CallStaticVoidMethod(IDCache::GetPermissionHandlerClass(),
|
||||
IDCache::GetPermissionHandlerRequestRecordAudioPermission(),
|
||||
nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
cubeb_stream_params params{};
|
||||
params.format = CUBEB_SAMPLE_S16LE;
|
||||
params.rate = SAMPLING_RATE;
|
||||
|
Reference in New Issue
Block a user