34 static constexpr bool DEVICE_ENUMERATION_FAIL =
false;
40 static constexpr bool DEVICE_ENUMERATION_SUCCESS =
true;
237 AudioObject*
Play(
const std::filesystem::path& filePath, uint32_t playCount,
bool isPaused);
264 AudioObject*
Load(
const std::filesystem::path& filePath, uint32_t playCount,
bool isPaused);
AudioDeviceType
Definition AudioDevice.h:11
#define HEPH_API
Definition HephShared.h:132
stores encoded audio data.
Definition EncodedAudioBuffer.h:15
base class for the classes that interact with the native audio APIs.
Definition NativeAudio.h:28
std::thread captureThread
Definition NativeAudio.h:83
virtual ~NativeAudio()=default
std::string captureDeviceId
Definition NativeAudio.h:101
virtual double GetMasterVolume() const =0
std::vector< AudioObject > audioObjects
Definition NativeAudio.h:59
AudioObject * Play(const std::filesystem::path &filePath)
AudioObject * GetAudioObject(const std::string &audioObjectName)
void InitializeCapture(AudioChannelLayout channelLayout, uint32_t sampleRate)
Heph::Event OnAudioDeviceAdded
Definition NativeAudio.h:162
bool disposing
Definition NativeAudio.h:119
std::thread renderThread
Definition NativeAudio.h:77
std::shared_ptr< IAudioDecoder > pAudioDecoder
Definition NativeAudio.h:47
const AudioFormatInfo & GetCaptureFormat() const
virtual void StopRendering()=0
std::thread deviceThread
Definition NativeAudio.h:89
bool AudioObjectExists(const Heph::Guid &audioObjectId) const
AudioFormatInfo captureFormat
Definition NativeAudio.h:113
bool isCaptureInitialized
Definition NativeAudio.h:131
bool isRenderInitialized
Definition NativeAudio.h:125
bool AudioObjectExists(AudioObject *pAudioObject) const
Heph::Event OnCapture
Definition NativeAudio.h:174
uint32_t GetDeviceEnumerationPeriod() const
virtual void InitializeCapture(AudioDevice *device, AudioFormatInfo format)=0
bool isCapturePaused
Definition NativeAudio.h:137
AudioObject * CreateAudioObject(const std::string &name, size_t bufferFrameCount, AudioChannelLayout channelLayout, uint16_t sampleRate)
Heph::Event OnAudioDeviceRemoved
Definition NativeAudio.h:168
virtual void SetMasterVolume(double volume)=0
std::thread::id mainThreadId
Definition NativeAudio.h:71
size_t GetAudioObjectCount() const
AudioObject * Play(const std::filesystem::path &filePath, uint32_t playCount)
AudioDevice GetRenderDevice() const
std::string renderDeviceId
Definition NativeAudio.h:95
std::vector< AudioDevice > audioDevices
Definition NativeAudio.h:65
AudioObject * Load(const std::filesystem::path &filePath)
AudioObject * Load(const std::filesystem::path &filePath, uint32_t playCount)
AudioObject * Play(const std::filesystem::path &filePath, uint32_t playCount, bool isPaused)
virtual bool EnumerateAudioDevices()=0
AudioObject * Load(const std::filesystem::path &filePath, uint32_t playCount, bool isPaused)
virtual double GetFinalAOVolume(AudioObject *pAudioObject) const
void InitializeCapture(AudioFormatInfo format)
std::shared_ptr< IAudioEncoder > pAudioEncoder
Definition NativeAudio.h:53
AudioObject * GetAudioObject(const Heph::Guid &audioObjectId)
size_t GetAOCountToMix() const
std::vector< AudioDevice > GetAudioDevices(AudioDeviceType deviceType) const
std::mutex audioDevicesMutex
Definition NativeAudio.h:149
virtual void StopCapturing()=0
AudioDevice GetDefaultAudioDevice(AudioDeviceType deviceType) const
void SetAudioDecoder(std::shared_ptr< IAudioDecoder > pNewDecoder)
EncodedAudioBuffer Mix(uint32_t frameCount)
virtual void InitializeRender(AudioDevice *device, AudioFormatInfo format)=0
bool DestroyAudioObject(AudioObject *pAudioObject)
bool IsCapturePaused() const
AudioFormatInfo renderFormat
Definition NativeAudio.h:107
std::shared_ptr< IAudioDecoder > GetAudioDecoder() const
AudioObject * GetAudioObject(size_t index)
virtual void GetNativeParams(NativeAudioParams &nativeParams) const =0
void SetDeviceEnumerationPeriod(uint32_t deviceEnumerationPeriod_ms)
AudioDevice GetAudioDeviceById(const std::string &deviceId) const
virtual void CheckAudioDevices()
void SetAudioEncoder(std::shared_ptr< IAudioEncoder > pNewEncoder)
bool DestroyAudioObject(const Heph::Guid &audioObjectId)
AudioDevice GetCaptureDevice() const
uint32_t deviceEnumerationPeriod_ms
Definition NativeAudio.h:143
std::recursive_mutex audioObjectsMutex
Definition NativeAudio.h:155
std::shared_ptr< IAudioEncoder > GetAudioEncoder() const
void InitializeRender(AudioChannelLayout channelLayout, uint32_t sampleRate)
void InitializeRender(AudioFormatInfo format)
const AudioFormatInfo & GetRenderFormat() const
virtual void SetNativeParams(const NativeAudioParams &nativeParams)=0
class for managing callback functions.
Definition Event.h:25
stores information about the channel layout.
Definition AudioChannelLayout.h:136
stores information about an audio device.
Definition AudioDevice.h:76
stores information that's necessary to play audio.
Definition AudioObject.h:36
base class for storing the native audio API specific parameters.
Definition NativeAudioParams.h:15
struct for storing globally unique identifiers.
Definition Guid.h:14