UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Audio::FMixerPlatformCoreAudio Class Reference

#include <AudioMixerPlatformCoreAudio.h>

+ Inheritance diagram for Audio::FMixerPlatformCoreAudio:

Public Member Functions

 FMixerPlatformCoreAudio ()
 
 ~FMixerPlatformCoreAudio ()
 
virtual FString GetPlatformApi () const override
 
virtual bool InitializeHardware () override
 
virtual bool CheckAudioDeviceChange () override
 
virtual bool TeardownHardware () override
 
virtual bool IsInitialized () const override
 
virtual bool GetNumOutputDevices (uint32 &OutNumOutputDevices) override
 
virtual bool GetOutputDeviceInfo (const uint32 InDeviceIndex, FAudioPlatformDeviceInfo &OutInfo) override
 
virtual bool GetDefaultOutputDeviceIndex (uint32 &OutDefaultDeviceIndex) const override
 
virtual bool OpenAudioStream (const FAudioMixerOpenStreamParams &Params) override
 
virtual bool CloseAudioStream () override
 
virtual bool StartAudioStream () override
 
virtual bool StopAudioStream () override
 
virtual bool MoveAudioStreamToNewAudioDevice (const FString &InNewDeviceId) override
 
virtual FAudioPlatformDeviceInfo GetPlatformDeviceInfo () const override
 
virtual void SubmitBuffer (const uint8 *Buffer) override
 
virtual FString GetDefaultDeviceName () override
 
virtual FAudioPlatformSettings GetPlatformSettings () const override
 
virtual int32 GetNumFrames (const int32 InNumReqestedFrames) override
 
virtual void ResumeContext () override
 
virtual void SuspendContext () override
 
- Public Member Functions inherited from Audio::IAudioMixerPlatformInterface
virtual AUDIOMIXERCORE_API ~IAudioMixerPlatformInterface ()
 
virtual void ResumePlaybackOnNewDevice ()
 
virtual FString GetCurrentDeviceName () const
 
virtual AUDIOMIXERCORE_API int32 GetIndexForDevice (const FString &InDeviceName)
 
virtual bool MoveAudioStreamToNewAudioDevice ()
 
virtual bool RequestDeviceSwap (const FString &DeviceID, bool bInForce, const TCHAR *InReason=nullptr)
 
virtual void SubmitDirectOutBuffer (const int32 InDirectOutIndex, const Audio::FAlignedFloatBuffer &InBuffer)
 
virtual bool DisablePCMAudioCaching () const
 
virtual bool SupportsHardwareDecompression () const
 
virtual bool IsNonRealtime () const
 
virtual void OnHardwareUpdate ()
 
virtual IAudioPlatformDeviceInfoCacheGetDeviceInfoCache () const
 
virtual bool IsDeviceInfoValid (const FAudioPlatformDeviceInfo &InDeviceInfo) const
 
virtual bool ShouldUseDeviceInfoCache () const
 
AUDIOMIXERCORE_API uint32 Run () override
 
virtual class FSingleThreadRunnableGetSingleThreadInterface () override
 
virtual AUDIOMIXERCORE_API void Tick () override
 
AUDIOMIXERCORE_API IAudioMixerPlatformInterface ()
 
AUDIOMIXERCORE_API void ReadNextBuffer ()
 
virtual AUDIOMIXERCORE_API void FadeIn ()
 
virtual AUDIOMIXERCORE_API void FadeOut ()
 
FString GetLastError () const
 
AUDIOMIXERCORE_API void PostInitializeHardware ()
 
bool GetIsListeningForDeviceEvents () const
 
void SetIsListeningForDeviceEvents (bool bInListeningForDeviceEvents)
 
- Public Member Functions inherited from FRunnable
virtual bool Init ()
 
virtual void Stop ()
 
virtual void Exit ()
 
virtual ~FRunnable ()
 
- Public Member Functions inherited from FSingleThreadRunnable
virtual ~FSingleThreadRunnable ()
 
- Public Member Functions inherited from Audio::IAudioMixerDeviceChangedListener
virtual ~IAudioMixerDeviceChangedListener ()=default
 
virtual void RegisterDeviceChangedListener ()
 
virtual void UnregisterDeviceChangedListener ()
 
virtual void OnDefaultCaptureDeviceChanged (const EAudioDeviceRole InAudioDeviceRole, const FString &DeviceId)
 
virtual void OnDefaultRenderDeviceChanged (const EAudioDeviceRole InAudioDeviceRole, const FString &DeviceId)
 
virtual void OnDeviceAdded (const FString &DeviceId, bool bIsRenderDevice)
 
virtual void OnDeviceRemoved (const FString &DeviceId, bool bIsRenderDevice)
 
virtual void OnDeviceStateChanged (const FString &DeviceId, const EAudioDeviceState InState, bool bIsRenderDevice)
 
virtual void OnFormatChanged (const FString &InDeviceId, const FFormatChangedData &InFormat)
 
virtual void OnSessionDisconnect (EDisconnectReason InReason)
 
virtual FString GetDeviceId () const
 

Additional Inherited Members

- Public Types inherited from Audio::IAudioMixerDeviceChangedListener
enum class  EDisconnectReason {
  DeviceRemoval , ServerShutdown , FormatChanged , SessionLogoff ,
  SessionDisconnected , ExclusiveModeOverride
}
 
- Static Public Member Functions inherited from Audio::IAudioMixerPlatformInterface
static AUDIOMIXERCORE_API bool GetChannelTypeAtIndex (const int32 Index, EAudioMixerChannel::Type &OutType)
 
- Protected Member Functions inherited from Audio::IAudioMixerPlatformInterface
AUDIOMIXERCORE_API uint32 MainAudioDeviceRun ()
 
virtual AUDIOMIXERCORE_API uint32 RunInternal ()
 
void AudioMixerPlatformLogOnce (const FString &LogDetails, const FString &FileName, int32 LineNumber, ELogVerbosity::Type InVerbosity=ELogVerbosity::Error)
 
AUDIOMIXERCORE_API void BeginGeneratingAudio ()
 
AUDIOMIXERCORE_API void StopGeneratingAudio ()
 
AUDIOMIXERCORE_API void ApplyMasterAttenuation (TArrayView< const uint8 > &InOutPoppedAudio)
 
AUDIOMIXERCORE_API void ApplyPrimaryAttenuation (TArrayView< const uint8 > &InOutPoppedAudio)
 
template<typename BufferType >
void ApplyAttenuationInternal (TArrayView< BufferType > &InOutBuffer)
 
AUDIOMIXERCORE_API void StartRunningNullDevice ()
 
AUDIOMIXERCORE_API void StopRunningNullDevice ()
 
AUDIOMIXERCORE_API void CreateNullDeviceThread (const TFunction< void()> InCallback, float InBufferDuration, bool bShouldPauseOnStart)
 
- Protected Attributes inherited from Audio::IAudioMixerPlatformInterface
FAudioOutputStreamInfo AudioStreamInfo
 
FAudioMixerOpenStreamParams OpenStreamParams
 
Audio::FOutputBuffer OutputBuffer
 
bool bWarnedBufferUnderrun
 
TUniquePtr< FRunnableThreadAudioRenderThread
 
FEventAudioRenderEvent
 
FCriticalSection DeviceSwapCriticalSection
 
FThreadSafeBool bIsInDeviceSwap
 
FEventAudioFadeEvent
 
int32 NumOutputBuffers
 
float FadeVolume
 
FParam FadeParam
 
FString CurrentDeviceName
 
FString LastError
 
int32 CallCounterApplyAttenuationInternal { 0 }
 
int32 CallCounterReadNextBuffer { 0 }
 
FThreadSafeBool bPerformingFade
 
FThreadSafeBool bFadedOut
 
FThreadSafeBool bIsDeviceInitialized
 
FThreadSafeBool bMoveAudioStreamToNewAudioDevice
 
FThreadSafeBool bIsUsingNullDevice
 
FThreadSafeBool bIsGeneratingAudio
 
const int32 InstanceID { -1 }
 
- Static Protected Attributes inherited from Audio::IAudioMixerPlatformInterface
static AUDIOMIXERCORE_API FThreadSafeCounter NextInstanceID
 

Constructor & Destructor Documentation

◆ FMixerPlatformCoreAudio()

Audio::FMixerPlatformCoreAudio::FMixerPlatformCoreAudio ( )

◆ ~FMixerPlatformCoreAudio()

Audio::FMixerPlatformCoreAudio::~FMixerPlatformCoreAudio ( )

Member Function Documentation

◆ CheckAudioDeviceChange()

bool Audio::FMixerPlatformCoreAudio::CheckAudioDeviceChange ( )
overridevirtual

Check if audio device changed if applicable. Return true if audio device changed.

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ CloseAudioStream()

bool Audio::FMixerPlatformCoreAudio::CloseAudioStream ( )
overridevirtual

Closes the audio stream (if it's open).

Implements Audio::IAudioMixerPlatformInterface.

◆ GetDefaultDeviceName()

FString Audio::FMixerPlatformCoreAudio::GetDefaultDeviceName ( )
overridevirtual

Return any optional device name defined in platform configuratio.

Implements Audio::IAudioMixerPlatformInterface.

◆ GetDefaultOutputDeviceIndex()

bool Audio::FMixerPlatformCoreAudio::GetDefaultOutputDeviceIndex ( uint32 OutDefaultDeviceIndex) const
overridevirtual

Returns the default device index.

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ GetNumFrames()

int32 Audio::FMixerPlatformCoreAudio::GetNumFrames ( const int32  InNumReqestedFrames)
overridevirtual

Allows platforms to filter the requested number of frames to render. Some platforms only support specific frame counts.

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ GetNumOutputDevices()

bool Audio::FMixerPlatformCoreAudio::GetNumOutputDevices ( uint32 OutNumOutputDevices)
overridevirtual

Returns the number of output devices.

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ GetOutputDeviceInfo()

bool Audio::FMixerPlatformCoreAudio::GetOutputDeviceInfo ( const uint32  InDeviceIndex,
FAudioPlatformDeviceInfo OutInfo 
)
overridevirtual

Gets the device information of the given device index.

Implements Audio::IAudioMixerPlatformInterface.

◆ GetPlatformApi()

virtual FString Audio::FMixerPlatformCoreAudio::GetPlatformApi ( ) const
inlineoverridevirtual

Returns the platform API name.

Implements Audio::IAudioMixerPlatformInterface.

◆ GetPlatformDeviceInfo()

FAudioPlatformDeviceInfo Audio::FMixerPlatformCoreAudio::GetPlatformDeviceInfo ( ) const
overridevirtual

Returns the platform device info of the currently open audio stream.

Implements Audio::IAudioMixerPlatformInterface.

◆ GetPlatformSettings()

FAudioPlatformSettings Audio::FMixerPlatformCoreAudio::GetPlatformSettings ( ) const
overridevirtual

Gets the platform specific audio settings.

Implements Audio::IAudioMixerPlatformInterface.

◆ InitializeHardware()

bool Audio::FMixerPlatformCoreAudio::InitializeHardware ( )
overridevirtual

Initialize the hardware.

Implements Audio::IAudioMixerPlatformInterface.

◆ IsInitialized()

bool Audio::FMixerPlatformCoreAudio::IsInitialized ( ) const
overridevirtual

Is the hardware initialized.

Implements Audio::IAudioMixerPlatformInterface.

◆ MoveAudioStreamToNewAudioDevice()

bool Audio::FMixerPlatformCoreAudio::MoveAudioStreamToNewAudioDevice ( const FString &  InNewDeviceId)
overridevirtual

Resets the audio stream to use a new audio device with the given device ID (empty string means default).

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ OpenAudioStream()

bool Audio::FMixerPlatformCoreAudio::OpenAudioStream ( const FAudioMixerOpenStreamParams Params)
overridevirtual

Opens up a new audio stream with the given parameters.

Implements Audio::IAudioMixerPlatformInterface.

◆ ResumeContext()

void Audio::FMixerPlatformCoreAudio::ResumeContext ( )
overridevirtual

◆ StartAudioStream()

bool Audio::FMixerPlatformCoreAudio::StartAudioStream ( )
overridevirtual

Starts the audio stream processing and generating audio.

Implements Audio::IAudioMixerPlatformInterface.

◆ StopAudioStream()

bool Audio::FMixerPlatformCoreAudio::StopAudioStream ( )
overridevirtual

Stops the audio stream (but keeps the audio stream open).

Implements Audio::IAudioMixerPlatformInterface.

◆ SubmitBuffer()

void Audio::FMixerPlatformCoreAudio::SubmitBuffer ( const uint8 Buffer)
overridevirtual

Submit the given buffer to the platform's output audio device.

Reimplemented from Audio::IAudioMixerPlatformInterface.

◆ SuspendContext()

void Audio::FMixerPlatformCoreAudio::SuspendContext ( )
overridevirtual

◆ TeardownHardware()

bool Audio::FMixerPlatformCoreAudio::TeardownHardware ( )
overridevirtual

Teardown the hardware.

Implements Audio::IAudioMixerPlatformInterface.


The documentation for this class was generated from the following files: