Path: blob/master/RSDKv5/RSDK/Audio/Oboe/OboeAudioDevice.hpp
1185 views
#define LockAudioDevice() pthread_mutex_lock(&AudioDevice::mutex);1#define UnlockAudioDevice() pthread_mutex_unlock(&AudioDevice::mutex);23#include <oboe/Oboe.h>45namespace RSDK6{7struct AudioDevice : public AudioDeviceBase, public oboe::AudioStreamDataCallback, public oboe::AudioStreamErrorCallback {8static bool32 Init();9static void Release();1011static void FrameInit();1213static void HandleStreamLoad(ChannelInfo *channel, bool32 async);1415static pthread_mutex_t mutex;1617oboe::DataCallbackResult onAudioReady(oboe::AudioStream *s, void *data, int32 len);18void onErrorAfterClose(oboe::AudioStream *s, oboe::Result error);1920private:21static uint8 contextInitialized;22static oboe::Result status;23static oboe::AudioStream *stream;2425static AudioDevice *audioDevice; // can't believe i have to do this2627static void InitAudioChannels();28static void InitMixBuffer() {}2930static void *LoadStreamASync(void *channel)31{32LoadStream((ChannelInfo *)channel);33pthread_exit(NULL);34};3536static bool createStream();37static bool shutdownStream();38};39} // namespace RSDK404142