Navigation
API > API/Runtime > API/Runtime/AudioMixerCore
Abstract interface for mixer platform.
| Name | IAudioMixerPlatformInterface |
| Type | class |
| Header File | /Engine/Source/Runtime/AudioMixerCore/Public/AudioMixer.h |
| Include Path | #include "AudioMixer.h" |
Syntax
class IAudioMixerPlatformInterface :
public FRunnable,
public FSingleThreadRunnable,
public Audio::IAudioMixerDeviceChangedListener
Inheritance Hierarchy
- FRunnable → IAudioMixerPlatformInterface
- FSingleThreadRunnable → IAudioMixerPlatformInterface
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
IAudioMixerPlatformInterface() |
Constructor. | AudioMixer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IAudioMixerPlatformInterface() |
Virtual destructor. | AudioMixer.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| NextInstanceID | FThreadSafeCounter | A Counter to provide the next unique id. | AudioMixer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsListeningForDeviceEvents | bool | Used to determine if this object is listening to system device change events. | AudioMixer.h | |
| NullDeviceCallback | TUniquePtr< FMixerNullCallback > | AudioMixer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CheckAudioDeviceChange() |
Check if audio device changed if applicable. Return true if audio device changed. | AudioMixer.h | |
bool CloseAudioStream() |
Closes the audio stream (if it's open). | AudioMixer.h | |
virtual bool DisablePCMAudioCaching() |
Whether or not the platform disables caching of decompressed PCM data (i.e. to save memory on fixed memory platforms) | AudioMixer.h | |
virtual void FadeIn() |
Reset the fade state (use if reusing audio platform interface, e.g. in main audio device. | AudioMixer.h | |
virtual void FadeOut() |
Start a fadeout. Prevents pops during shutdown. | AudioMixer.h | |
virtual FString GetCurrentDeviceName() |
Returns the name of the currently used audio device. | AudioMixer.h | |
FString GetDefaultDeviceName() |
Return any optional device name defined in platform configuratio. | AudioMixer.h | |
virtual bool GetDefaultOutputDeviceIndex
(
uint32& OutDefaultDeviceIndex |
Returns the default device index. | AudioMixer.h | |
virtual IAudioPlatformDeviceInfoCache * GetDeviceInfoCache() |
Get the DeviceInfo Cache if one exists. | AudioMixer.h | |
virtual int32 GetIndexForDevice
(
const FString& InDeviceName |
Can be used to look up the current index for a given device name. | AudioMixer.h | |
bool GetIsListeningForDeviceEvents() |
Used to determine if this object is listening to system device change events. | AudioMixer.h | |
FString GetLastError() |
Returns the last error generated. | AudioMixer.h | |
virtual int32 GetNumFrames
(
const int32 InNumReqestedFrames |
Allows platforms to filter the requested number of frames to render. | AudioMixer.h | |
virtual bool GetNumOutputDevices
(
uint32& OutNumOutputDevices |
Returns the number of output devices. | AudioMixer.h | |
bool GetOutputDeviceInfo
(
const uint32 InDeviceIndex, |
Gets the device information of the given device index. | AudioMixer.h | |
FString GetPlatformApi() |
Returns the platform API name. | AudioMixer.h | |
FAudioPlatformDeviceInfo GetPlatformDeviceInfo() |
Returns the platform device info of the currently open audio stream. | AudioMixer.h | |
FAudioPlatformSettings GetPlatformSettings() |
Gets the platform specific audio settings. | AudioMixer.h | |
virtual FSingleThreadRunnable * GetSingleThreadInterface() |
FSingleThreadRunnable accessor for ticking this FRunnable when multi-threading is disabled. | AudioMixer.h | |
bool InitializeHardware() |
Initialize the hardware. | AudioMixer.h | |
virtual bool IsDeviceInfoValid
(
const FAudioPlatformDeviceInfo& InDeviceInfo |
Determine if the given device info struct is valid for use with this platform. | AudioMixer.h | |
bool IsInitialized() |
Is the hardware initialized. | AudioMixer.h | |
virtual bool IsNonRealtime () |
Whether this is an interface for a non-realtime renderer. | AudioMixer.h | |
virtual bool MoveAudioStreamToNewAudioDevice () |
AudioMixer.h | ||
virtual bool MoveAudioStreamToNewAudioDevice
(
const FString& InNewDeviceId |
Resets the audio stream to use a new audio device with the given device ID (empty string means default). | AudioMixer.h | |
virtual void OnHardwareUpdate() |
Function called at the beginning of every call of UpdateHardware on the audio thread. | AudioMixer.h | |
bool OpenAudioStream
(
const FAudioMixerOpenStreamParams& Params |
Opens up a new audio stream with the given parameters. | AudioMixer.h | |
void PostInitializeHardware() |
This is called after InitializeHardware() is called. | AudioMixer.h | |
void ReadNextBuffer() |
Retrieves the next generated buffer and feeds it to the platform mixer output stream. | AudioMixer.h | |
virtual bool RequestDeviceSwap
(
const FString& DeviceID, |
Sends a command to swap which output device is being used | AudioMixer.h | |
virtual void ResumeContext() |
Function to resume audio rendering. Used on mobile platforms which can suspend the application. | AudioMixer.h | |
virtual void ResumePlaybackOnNewDevice() |
Resumes playback on new audio device after device change. | AudioMixer.h | |
uint32 Run() |
AudioMixer.h | ||
void SetIsListeningForDeviceEvents
(
bool bInListeningForDeviceEvents |
AudioMixer.h | ||
virtual bool ShouldUseDeviceInfoCache() |
Subclasses can override to determine if it should use Cache for DeviceInfo Enumeration. | AudioMixer.h | |
bool StartAudioStream() |
Starts the audio stream processing and generating audio. | AudioMixer.h | |
bool StopAudioStream() |
Stops the audio stream (but keeps the audio stream open). | AudioMixer.h | |
virtual void SubmitBuffer
(
const uint8* Buffer |
Submit the given buffer to the platform's output audio device. | AudioMixer.h | |
virtual void SubmitDirectOutBuffer
(
const int32 InDirectOutIndex, |
Submit a buffer that is to be output directly through a discreet device channel. | AudioMixer.h | |
virtual bool SupportsHardwareDecompression() |
Whether or not this platform has hardware decompression. | AudioMixer.h | |
virtual void SuspendContext() |
Function to stop all audio from rendering. Used on mobile platforms which can suspend the application. | AudioMixer.h | |
bool TeardownHardware() |
Teardown the hardware. | AudioMixer.h | |
virtual void Tick() |
AudioMixer.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplyAttenuationInternal
(
TArrayView< BufferType >& InOutBuffer |
AudioMixer.h | ||
void ApplyMasterAttenuation
(
TArrayView< const uint8 >& InOutPoppedAudio |
Deprecated - use ApplyPrimaryAttenuation | AudioMixer.h | |
void ApplyPrimaryAttenuation
(
TArrayView< const uint8 >& InOutPoppedAudio |
Performs buffer fades for shutdown/startup of audio mixer. | AudioMixer.h | |
void AudioMixerPlatformLogOnce
(
const FString& LogDetails, |
Is called when an error, warning or log is generated. | AudioMixer.h | |
void BeginGeneratingAudio() |
Start generating audio from our mixer. | AudioMixer.h | |
void CreateNullDeviceThread
(
const TFunction< void()> InCallback, |
Called by platform specific logic to pre-create or create the null renderer thread | AudioMixer.h | |
uint32 MainAudioDeviceRun() |
Run the "main" audio device. | AudioMixer.h | |
virtual uint32 RunInternal() |
Wrapper around the thread Run. This is virtualized so a platform can fundamentally override the render function. | AudioMixer.h | |
void StartRunningNullDevice() |
When called, spins up a thread to start consuming output when no audio device is available. | AudioMixer.h | |
void StopGeneratingAudio() |
Stops the render thread from generating audio. | AudioMixer.h | |
void StopRunningNullDevice() |
When called, terminates the null device. | AudioMixer.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool GetChannelTypeAtIndex
(
const int32 Index, |
Helper function to gets the channel map type at the given index. | AudioMixer.h |