Navigation
API > API/Runtime > API/Runtime/AudioMixer
References
| Module | AudioMixer |
| Header | /Engine/Source/Runtime/AudioMixer/Public/AudioMixerSubmix.h |
| Include | #include "AudioMixerSubmix.h" |
Syntax
class FMixerSubmix
Variables
| Type | Name | Description | |
|---|---|---|---|
| TUniquePtr< IAudioLink > | AudioLinkInstance | ||
| double | AutoDisableTime | The time to wait to disable the submix if the auto-disablement is active. | |
| uint8: 1 | bAutoDisable | Whether or not auto-disablement is enabled. If true, the submix will disable itself. | |
| uint8: 1 | bIsBackgroundMuted | Whether or not this submix is muted. | |
| uint8: 1 | bIsCurrentlyDisabled | Whether or not we're currently disabled (i.e. the submix has been silent) | |
| FThreadSafeBool | bIsEnvelopeFollowing | Bool set to true when envelope following is enabled. | |
| uint8: 1 | bIsRecording | Bool set to true when this submix is recording data. | |
| uint8: 1 | bIsSilent | Whether or not the submix is currently rendering audio. I.e. audio was sent to it and mixing it, or any of its child submixes are rendering audio. | |
| FThreadSafeBool | bIsSpectrumAnalyzing | Bool set to true when spectrum analysis is enabled. | |
| FCriticalSection | BufferListenerCriticalSection | Critical section used for modifying and interacting with buffer listeners. | |
| TArray< ISubmixBufferListener * > | BufferListeners | List of submix buffer listeners. | |
| TMap< uint32, FChildSubmixInfo > | ChildSubmixes | Child submixes. | |
| TQueue< TFunction< void()> > | CommandQueue | Submix command queue to shuffle commands from audio thread to audio render thread. | |
| float | CurrentDryLevel | ||
| float | CurrentOutputVolume | ||
| float | CurrentWetLevel | ||
| FAlignedFloatBuffer | DownmixedBuffer | ||
| FAlignedFloatBuffer | DryChannelBuffer | The dry channel buffer. | |
| FModulationDestination | DryLevelMod | ||
| float | DryLevelModifier | ||
| float | DryModBaseDb | ||
| FCriticalSection | EffectChainMutationCriticalSection | Critical section for mutation of the effect chain. | |
| FAlignedFloatBuffer | EffectChainOutputBuffer | ||
| TArray< FSubmixEffectFadeInfo > | EffectChains | The array of submix effect overrides. There may be more than one if multiple are fading out. There should be only one fading in (the current override). | |
| FEndpointData | EndpointData | ||
| FCriticalSection | EnvelopeCriticalSection | ||
| Audio::FEnvelopeFollower | EnvelopeFollower | ||
| int32 | EnvelopeNumChannels | ||
| float[8] | EnvelopeValues | Envelope following data. | |
| uint32 | Id | This mixer submix's Id. | |
| FAlignedFloatBuffer | InputBuffer | ||
| FMixerDevice * | MixerDevice | Owning mixer device. | |
| TMap< FMixerSourceVoice *, FSubmixVoiceData > | MixerSourceVoices | Map of mixer source voices with a given send level for this submix. | |
| FAlignedFloatBuffer | MonoMixBuffer | This buffer is used to downmix the submix output to mono before submitting it to the SpectrumAnalyzer. | |
| int32 | NumChannels | ||
| int32 | NumSamples | ||
| int32 | NumSubmixEffects | Returns the number of submix effects. | |
| FOnSubmixEnvelope | OnSubmixEnvelope | Multi-cast delegate to broadcast envelope data from this submix instance. | |
| TWeakObjectPtr< const USoundSubmixBase > | OwningSubmixObject | Handle back to the owning USoundSubmix. Used when the device is shutdown to prematurely end a recording. | |
| TWeakPtr< FMixerSubmix, ESPMode::ThreadSafe > | ParentSubmix | Parent submix. | |
| Audio::FPatchSplitter | PatchSplitter | ||
| FCriticalSection | RecordingCriticalSection | Critical section used for when we are appending recorded data. | |
| FAlignedFloatBuffer | RecordingData | This buffer is used for recorded output of the submix. | |
| FAlignedFloatBuffer | ScratchBuffer | ||
| double | SilenceTimeStartSeconds | The time that the first full silent buffer was detected in the submix. Submix will auto-disable if the timeout is reached and the submix has bAutoDisable set to true. | |
| FSoundfieldStreams | SoundfieldStreams | ||
| FAlignedFloatBuffer | SourceInputBuffer | ||
| TArray< FSpectrumAnalysisDelegateInfo > | SpectralAnalysisDelegates | ||
| TSharedPtr< FAsyncSpectrumAnalyzer, ESPMode::ThreadSafe > | SpectrumAnalyzer | ||
| FCriticalSection | SpectrumAnalyzerCriticalSection | Spectrum analyzer. Created and destroyed on the audio thread. | |
| FSoundSpectrumAnalyzerSettings | SpectrumAnalyzerSettings | ||
| FAlignedFloatBuffer | SubmixChainMixBuffer | ||
| FString | SubmixName | The name of this submix (the owning USoundSubmix) | |
| float | TargetDryLevel | ||
| float | TargetOutputVolume | ||
| float | TargetWetLevel | ||
| FModulationDestination | VolumeMod | ||
| float | VolumeModBaseDb | ||
| float | VolumeModifier | Modifiers set from BP code | |
| FModulationDestination | WetLevelMod | ||
| float | WetLevelModifier | ||
| float | WetModBaseDb |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMixerSubmix
(
FMixerDevice* InMixerDevice |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddChildSubmix
(
TWeakPtr< FMixerSubmix, ESPMode::ThreadSafe > Submix |
Adds the given submix to this submix's children. | |
| void | AddEnvelopeFollowerDelegate
(
const FOnSubmixEnvelopeBP& OnSubmixEnvelopeBP |
Adds an envelope follower delegate. | |
| void | AddOrSetSourceVoice
(
FMixerSourceVoice* InSourceVoice, |
Add (if not already added) or sets the amount of the source voice's send amount. | |
| FPatchOutputStrongPtr | AddPatch
(
float InGain |
||
| void | AddSoundEffectSubmix
(
FSoundEffectSubmixPtr InSoundEffectSubmix |
Appends the effect submix to the effect submix chain. | |
| void | AddSpectralAnalysisDelegate
(
const FSoundSpectrumAnalyzerDelegateSettings& InDelegateSettings, |
Adds an spectral analysis delegate. | |
| void | Broadcast the envelope and submix delegates on the game thread. | ||
| void | Clears all submix effects from the effect submix chain. | ||
| void | ClearSubmixEffectChainOverride
(
float InFadeTimeSec |
Clears any submix effect chain overrides in the given fade time in seconds. | |
| void | DownmixBuffer
(
const int32 InChannels, |
Down mix the given buffer to the desired down mix channel count. | |
| bool | GenerateEffectChainAudio
(
FSoundEffectSubmixInputData& InputData, |
Generates audio from the given effect chain into the given buffer. | |
| FSoundfieldSpeakerPositionalData | |||
| uint32 | GetId () |
Returns the mixer submix Id. | |
| FAudioPluginInitializationParams | |||
| FSoundfieldEncodingKey | Get a unique key for this submix's format and settings. | ||
| void | GetMagnitudeForFrequencies
(
const TArray< float >& InFrequencies, |
Gets the most recent magnitude values for each corresponding value in InFrequencies (in Hz). | |
| int32 | Returns the number of effects in this submix's effect chain. | ||
| int32 | Returns the number of wet effects in this submix. | ||
| int32 | Returns the output channels this submix is rendering to. | ||
| int32 | Returns the number of source voices currently a part of this submix. | ||
| TWeakPtr< FMixerSubmix, ESPMode::ThreadSafe > | Gets this submix's parent submix. | ||
| void | GetPhaseForFrequencies
(
const TArray< float >& InFrequencies, |
Gets the most recent phase values for each corresponding value in InFrequencies (in Hz). | |
| int32 | Returns the device sample rate this submix is rendering to. | ||
| int32 | Returns the size of the submix chain. | ||
| ISoundfieldFactory * | |||
| FName | |||
| ISoundfieldEncodingSettingsProxy & | |||
| int32 | Gets the submix channels channels. | ||
| FSoundEffectSubmixPtr | GetSubmixEffect
(
const int32 InIndex |
Returns the submix effect at the given effect chain index. | |
| TUniquePtr< ISoundfieldTranscodeStream > | GetTranscoderForChildSubmix
(
const TSharedPtr< Audio::FMixerSubmix, ESPMode::ThreadSafe >& InChildSubmix |
||
| void | Init
(
const USoundSubmixBase* InSoundSubmix, |
Initialize the submix object with the USoundSubmix ptr. Sets up child and parent connects. | |
| void | InitInternal () |
Initialize the submix internal. | |
| bool | Returns true if this submix sends it's audio to the default endpoint. | ||
| bool | Returns true if this is an endpoint type that should no-op for this platform. | ||
| bool | Returns true if this submix sends its audio to an IAudioEndpoint. | ||
| bool | Returns true if the submix is currently rendering audio. The current rendering time is passed in. | ||
| bool | Returns true if this submix sends its audio to an ISoundfieldEndpoint. | ||
| bool | Returns true if this submix is encoded to a soundfield. | ||
| bool | IsValid () |
Checks to see if submix is valid. | |
| void | MixBufferDownToMono
(
const FAlignedFloatBuffer& InBuffer, |
||
| void | MixInChildSubmix
(
FChildSubmixInfo& Child, |
Calls ProcessAudio on the child submix, performs all necessary conversions and mixes in it's resulting audio. | |
| void | MixInSource
(
const ISoundfieldAudioPacket& InAudio, |
Encode a source and sum it into the mixed soundfield. | |
| void | OnStartRecordingOutput
(
float ExpectedDuration |
This is called by the corresponding USoundSubmix when StartRecordingOutput is called. | |
| FAlignedFloatBuffer & | OnStopRecordingOutput
(
float& OutNumChannels, |
This is called by the corresponding USoundSubmix when StopRecordingOutput is called. | |
| void | This is called by the corresponding USoundSubmix when PauseRecording is called. | ||
| void | ProcessAudio
(
ISoundfieldAudioPacket& OutputAudio |
Function which processes audio. | |
| void | ProcessAudio
(
FAlignedFloatBuffer& OutAudio |
Function which processes audio. | |
| void | This should be called if this submix doesn't send it's audio to a parent submix, but rather an external endpoint. | ||
| void | Pump command queue. | ||
| void | RegisterBufferListener
(
ISubmixBufferListener* BufferListener |
Register buffer listener with this submix. | |
| void | RemoveChildSubmix
(
TWeakPtr< FMixerSubmix, ESPMode::ThreadSafe > SubmixWeakPtr |
Removes the given submix from this submix's children. | |
| void | RemoveSoundEffectSubmix
(
uint32 SubmixPresetId |
Removes the submix effect from the effect submix chain. | |
| void | RemoveSoundEffectSubmixAtIndex
(
int32 InIndex |
Removes the submix effect from the effect submix chain at the given submix index. | |
| void | RemoveSourceVoice
(
FMixerSourceVoice* InSourceVoice |
Removes the given source voice from the submix. | |
| void | RemoveSpectralAnalysisDelegate
(
const FOnSubmixSpectralAnalysisBP& OnSubmixSpectralAnalysisBP |
Removes an existing spectral analysis delegate. | |
| void | ReplaceSoundEffectSubmix
(
int32 InIndex, |
Swaps effect for provided submix at the given index. Fails if effect at index doesn't exist | |
| void | This is called by the corresponding USoundSubmix when ResumeRecording is called. | ||
| void | SendAudioToSubmixBufferListeners
(
FAlignedFloatBuffer& OutAudioBuffer |
||
| void | SetAutoDisable
(
bool bInAutoDisable |
Set whether or not this submix is told to auto disable. | |
| void | SetAutoDisableTime
(
float InAutoDisableTime |
Sets the auto-disable time. | |
| void | SetBackgroundMuted
(
bool bInMuted |
Whether or not this submix instance is muted. | |
| void | SetDryLevel
(
float InDryLevel |
Sets the static output volume of the submix in linear gain. | |
| void | SetModulationBaseLevels
(
float InVolumeModBaseDb, |
Update modulation settings of the submix with Decibel values. | |
| void | SetOutputVolume
(
float InOutputLevel |
Sets the output level of the submix in linear gain. | |
| void | SetParentSubmix
(
TWeakPtr< FMixerSubmix, ESPMode::ThreadSafe > Submix |
Sets the parent submix to the given submix. | |
| void | SetSoundfieldFactory
(
ISoundfieldFactory* InSoundfieldFactory |
This must be called on the entire submix graph before calling SetupSoundfieldStreams. | |
| void | SetSubmixEffectChainOverride
(
const TArray< FSoundEffectSubmixPtr >& InSubmixEffectPresetChain, |
Sets a submix effect chain override with the given fade time in seconds. | |
| void | SetupEndpoint
(
ISoundfieldEndpointFactory* InFactory, |
||
| void | SetupEndpoint
(
IAudioEndpointFactory* InFactory, |
||
| void | |||
| void | SetupSoundfieldEncodingForChild
(
FChildSubmixInfo& InChild |
||
| void | SetUpSoundfieldPositionalData
(
const TSharedPtr< Audio::FMixerSubmix, ESPMode::ThreadSafe >& InParentSubmix |
This sets up the ambisonics positional data for speakers, based on what new format we need to convert to. | |
| void | Check to see if we need to decode from ambisonics for parent. | ||
| void | SetupSoundfieldStreams
(
const USoundfieldEncodingSettingsBase* SoundfieldSettings, |
Updates settings, potentially creating or removing ambisonics streams based on what types of submixes this submix is connected to. | |
| void | SetWetLevel
(
float InWetLevel |
Sets the wet level of the submix in linear gain. | |
| void | StartEnvelopeFollowing
(
int32 AttackTime, |
Starts envelope following with the given attack time and release time. | |
| void | StartSpectrumAnalysis
(
const FSoundSpectrumAnalyzerSettings& InSettings |
Initializes a new FFT analyzer for this submix and immediately begins feeding audio to it. | |
| void | Stops envelope following the submix. | ||
| void | Terminates whatever FFT Analyzer is being used for this submix. | ||
| void | SubmixCommand
(
TFunction< void()> Command |
Add command to the command queue. | |
| void | |||
| void | UnregisterBufferListener
(
ISubmixBufferListener* BufferListener |
Unregister buffer listener with this submix. | |
| void | UpdateEndpointSettings
(
TUniquePtr< IAudioEndpointSettingsProxy >&& InSettings |
||
| void | UpdateEndpointSettings
(
TUniquePtr< ISoundfieldEndpointSettingsProxy >&& InSettings |
||
| void | UpdateListenerRotation
(
const FQuat& InRotation |
||
| void | UpdateModulationSettings
(
const TSet< TObjectPtr< USoundModulatorBase >>& InOutputModulators, |
Update modulation settings of the submix. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEndpointData | |||
| FSoundfieldEffectProcessorData | Individual processor in our | ||
| FSoundfieldStreams | |||
| FSpectralAnalysisBandInfo | |||
| FSpectrumAnalysisDelegateInfo | |||
| FSubmixEffectFadeInfo |