Navigation
API > API/Runtime > API/Runtime/AudioMixerCore
Inheritance Hierarchy
- IAudioMixerDeviceChangedListener
- IAudioMixerPlatformInterface
References
| Module | AudioMixerCore |
| Header | /Engine/Source/Runtime/AudioMixerCore/Public/AudioMixer.h |
| Include | #include "AudioMixer.h" |
Syntax
class IAudioMixerPlatformInterface :
public FRunnable ,
public FSingleThreadRunnable ,
public Audio::IAudioMixerDeviceChangedListener
Remarks
Abstract interface for mixer platform.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FEvent * | AudioFadeEvent | Event allows you to block until fadeout is complete. | |
| FEvent * | AudioRenderEvent | The render thread sync event. | |
| TUniquePtr< FRunnableThread > | AudioRenderThread | FRunnableThread* AudioRenderThread;. | |
| FAudioOutputStreamInfo | AudioStreamInfo | The audio device stream info. | |
| FThreadSafeBool | bFadedOut | ||
| FThreadSafeBool | bIsDeviceInitialized | ||
| FThreadSafeBool | bIsGeneratingAudio | ||
| FThreadSafeBool | bIsInDeviceSwap | This is used if we are attempting to TryLock on DeviceSwapCriticalSection, but a buffer callback is being called in the current thread. | |
| FThreadSafeBool | bIsUsingNullDevice | ||
| FThreadSafeBool | bMoveAudioStreamToNewAudioDevice | ||
| FThreadSafeBool | bPerformingFade | ||
| bool | bWarnedBufferUnderrun | Whether or not we warned of buffer underrun. | |
| int32 | CallCounterApplyAttenuationInternal | ||
| int32 | CallCounterReadNextBuffer | ||
| FString | CurrentDeviceName | This device name can be used to override the default device being used on platforms that use strings to identify audio devices. | |
| FCriticalSection | DeviceSwapCriticalSection | Critical Section used for times when we need the render loop to halt for the device swap. | |
| FParam | FadeParam | Source param used to fade in and out audio device. | |
| float | FadeVolume | The fade value. Used for fading in/out primary audio. | |
| const int32 | InstanceID | A Unique ID Identifying this instance. Mostly used for logging. | |
| FString | LastError | String containing the last generated error. | |
| int32 | NumOutputBuffers | The number of mixer buffers to queue on the output source voice. | |
| FAudioMixerOpenStreamParams | OpenStreamParams | ||
| Audio::FOutputBuffer | OutputBuffer | List of generated output buffers. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Constructor. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Virtual destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyAttenuationInternal
(
TArrayView< BufferType >& InOutBuffer |
||
| void | ApplyMasterAttenuation
(
TArrayView< const uint8 >& InOutPoppedAudio |
Deprecated - use ApplyPrimaryAttenuation | |
| void | ApplyPrimaryAttenuation
(
TArrayView< const uint8 >& InOutPoppedAudio |
Performs buffer fades for shutdown/startup of audio mixer. | |
| void | AudioMixerPlatformLogOnce
(
const FString& LogDetails, |
Is called when an error, warning or log is generated. | |
| void | Start generating audio from our mixer. | ||
| bool | Check if audio device changed if applicable. Return true if audio device changed. | ||
| bool | Closes the audio stream (if it's open). | ||
| void | CreateNullDeviceThread
(
const TFunction< void()> InCallback, |
Called by platform specific logic to pre-create or create the null renderer thread | |
| bool | Whether or not the platform disables caching of decompressed PCM data (i.e. to save memory on fixed memory platforms) | ||
| void | FadeIn () |
Reset the fade state (use if reusing audio platform interface, e.g. in main audio device. | |
| void | FadeOut () |
Start a fadeout. Prevents pops during shutdown. | |
| bool | GetChannelTypeAtIndex
(
const int32 Index, |
Helper function to gets the channel map type at the given index. | |
| FString | Returns the name of the currently used audio device. | ||
| FString | Return any optional device name defined in platform configuratio. | ||
| bool | GetDefaultOutputDeviceIndex
(
uint32& OutDefaultDeviceIndex |
Returns the default device index. | |
| IAudioPlatformDeviceInfoCache * | Get the DeviceInfo Cache if one exists. | ||
| int32 | GetIndexForDevice
(
const FString& InDeviceName |
Can be used to look up the current index for a given device name. | |
| FString | GetLastError () |
Returns the last error generated. | |
| int32 | GetNumFrames
(
const int32 InNumReqestedFrames |
Allows platforms to filter the requested number of frames to render. | |
| bool | GetNumOutputDevices
(
uint32& OutNumOutputDevices |
Returns the number of output devices. | |
| bool | GetOutputDeviceInfo
(
const uint32 InDeviceIndex, |
Gets the device information of the given device index. | |
| FString | Returns the platform API name. | ||
| FAudioPlatformDeviceInfo | Returns the platform device info of the currently open audio stream. | ||
| FAudioPlatformSettings | Gets the platform specific audio settings. | ||
| bool | Initialize the hardware. | ||
| bool | Is the hardware initialized. | ||
| bool | Whether this is an interface for a non-realtime renderer. | ||
| uint32 | Run the "main" audio device. | ||
| bool | MoveAudioStreamToNewAudioDevice
(
const FString& InNewDeviceId |
Resets the audio stream to use a new audio device with the given device ID (empty string means default). | |
| void | Function called at the beginning of every call of UpdateHardware on the audio thread. | ||
| bool | OpenAudioStream
(
const FAudioMixerOpenStreamParams& Params |
Opens up a new audio stream with the given parameters. | |
| void | This is called after InitializeHardware() is called. | ||
| void | Retrieves the next generated buffer and feeds it to the platform mixer output stream. | ||
| bool | RequestDeviceSwap
(
const FString& DeviceID, |
Sends a command to swap which output device is being used | |
| void | Function to resume audio rendering. Used on mobile platforms which can suspend the application. | ||
| void | Resumes playback on new audio device after device change. | ||
| uint32 | RunInternal () |
Wrapper around the thread Run. This is virtualized so a platform can fundamentally override the render function. | |
| bool | Starts the audio stream processing and generating audio. | ||
| void | When called, spins up a thread to start consuming output when no audio device is available. | ||
| bool | Stops the audio stream (but keeps the audio stream open). | ||
| void | Stops the render thread from generating audio. | ||
| void | When called, terminates the null device. | ||
| void | SubmitBuffer
(
const uint8* Buffer |
Submit the given buffer to the platform's output audio device. | |
| void | SubmitDirectOutBuffer
(
const int32 InDirectOutIndex, |
Submit a buffer that is to be output directly through a discreet device channel. | |
| bool | Whether or not this platform has hardware decompression. | ||
| void | Function to stop all audio from rendering. Used on mobile platforms which can suspend the application. | ||
| bool | Teardown the hardware. |
Overridden from FRunnable
| Type | Name | Description | |
|---|---|---|---|
| FSingleThreadRunnable * | FSingleThreadRunnable accessor for ticking this FRunnable when multi-threading is disabled. | ||
| uint32 | Run () |
Runs the runnable object. |
Overridden from FSingleThreadRunnable
| Type | Name | Description | |
|---|---|---|---|
| void | Tick () |
Tick function. |
Constants
| Name | Description |
|---|---|
| NextInstanceID | A Counter to provide the next unique id. |