35 static constexpr bool DEVICE_ENUMERATION_FAIL =
false;
41 static constexpr bool DEVICE_ENUMERATION_SUCCESS =
true;
AudioDeviceType
Definition AudioDevice.h:11
#define HEPH_API
Definition HephShared.h:124
stores encoded audio data.
Definition EncodedAudioBuffer.h:15
base class for the classes that interact with the native audio APIs.
Definition NativeAudio.h:29
std::thread captureThread
Definition NativeAudio.h:84
virtual ~NativeAudio()=default
std::string captureDeviceId
Definition NativeAudio.h:102
void InitializeCapture(const AudioChannelLayout &channelLayout, uint32_t sampleRate)
virtual double GetMasterVolume() const =0
AudioObject * Play(const std::filesystem::path &filePath)
AudioObject * GetAudioObject(const std::string &audioObjectName)
Heph::Event OnAudioDeviceAdded
Definition NativeAudio.h:163
bool disposing
Definition NativeAudio.h:120
std::thread renderThread
Definition NativeAudio.h:78
std::shared_ptr< IAudioDecoder > pAudioDecoder
Definition NativeAudio.h:48
const AudioFormatInfo & GetCaptureFormat() const
virtual void StopRendering()=0
std::thread deviceThread
Definition NativeAudio.h:90
bool AudioObjectExists(const Heph::Guid &audioObjectId) const
AudioFormatInfo captureFormat
Definition NativeAudio.h:114
bool isCaptureInitialized
Definition NativeAudio.h:132
bool isRenderInitialized
Definition NativeAudio.h:126
bool AudioObjectExists(AudioObject *pAudioObject) const
Heph::Event OnCapture
Definition NativeAudio.h:175
uint32_t GetDeviceEnumerationPeriod() const
virtual void InitializeCapture(AudioDevice *device, AudioFormatInfo format)=0
bool isCapturePaused
Definition NativeAudio.h:138
Heph::Event OnAudioDeviceRemoved
Definition NativeAudio.h:169
virtual void SetMasterVolume(double volume)=0
std::thread::id mainThreadId
Definition NativeAudio.h:72
size_t GetAudioObjectCount() const
void InitializeCapture(AudioDevice *device, const AudioChannelLayout &channelLayout, uint32_t sampleRate)
AudioObject * Play(const std::filesystem::path &filePath, uint32_t playCount)
AudioDevice GetRenderDevice() const
std::string renderDeviceId
Definition NativeAudio.h:96
std::vector< AudioDevice > audioDevices
Definition NativeAudio.h:66
AudioObject * Load(const std::filesystem::path &filePath)
AudioObject * Load(const std::filesystem::path &filePath, uint32_t playCount)
virtual bool EnumerateAudioDevices()=0
virtual double GetFinalAOVolume(AudioObject *pAudioObject) const
void InitializeCapture(AudioFormatInfo format)
void InitializeRender(AudioDevice *device, const AudioChannelLayout &channelLayout, uint32_t sampleRate)
void InitializeRender(const AudioChannelLayout &channelLayout, uint32_t sampleRate)
std::shared_ptr< IAudioEncoder > pAudioEncoder
Definition NativeAudio.h:54
AudioObject * GetAudioObject(const Heph::Guid &audioObjectId)
size_t GetAOCountToMix() const
std::vector< AudioDevice > GetAudioDevices(AudioDeviceType deviceType) const
std::mutex audioDevicesMutex
Definition NativeAudio.h:150
virtual void StopCapturing()=0
AudioDevice GetDefaultAudioDevice(AudioDeviceType deviceType) const
void SetAudioDecoder(std::shared_ptr< IAudioDecoder > pNewDecoder)
AudioObject * CreateAudioObject(const std::string &name, size_t bufferFrameCount, AudioChannelLayout channelLayout, uint32_t sampleRate)
EncodedAudioBuffer Mix(uint32_t frameCount)
virtual void InitializeRender(AudioDevice *device, AudioFormatInfo format)=0
bool DestroyAudioObject(AudioObject *pAudioObject)
std::list< AudioObject > audioObjects
Definition NativeAudio.h:60
bool IsCapturePaused() const
AudioFormatInfo renderFormat
Definition NativeAudio.h:108
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:144
std::recursive_mutex audioObjectsMutex
Definition NativeAudio.h:156
std::shared_ptr< IAudioEncoder > GetAudioEncoder() const
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:337
stores information about an audio device.
Definition AudioDevice.h:60
stores information that's necessary to play audio.
Definition AudioObject.h:33
base class for storing the native audio API specific parameters.
Definition NativeAudioParams.h:15
struct for storing globally unique identifiers.
Definition Guid.h:14