Navigation
API > API/Runtime > API/Runtime/AudioMixer
Class manages the runtime generation of scrubbed audio from a reference sound wave It does this using a simple granulation technique of overlapping grains using a Hanning window.
| Name | FSoundWaveScrubber |
| Type | class |
| Header File | /Engine/Source/Runtime/AudioMixer/Classes/Generators/SoundWaveScrubber.h |
| Include Path | #include "Generators/SoundWaveScrubber.h" |
Syntax
class FSoundWaveScrubber
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSoundWaveScrubber() |
Generators/SoundWaveScrubber.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FSoundWaveScrubber() |
Generators/SoundWaveScrubber.h |
Structs
| Name | Remarks |
|---|---|
| FDecodedDataChunk | Data for managing the decoded audio |
| FGrain | Active grain data for a single grain. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DecodedAudioSizeInSeconds | float | How much audio to decode per decode block. | Generators/SoundWaveScrubber.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveGrains | TArray< FGrain > | The grain data used to render the granular audio. | Generators/SoundWaveScrubber.h | |
| AudioMixerSampleRate | float | General state and/or settings | Generators/SoundWaveScrubber.h | |
| bHasErrorWithDecoder | bool | Whether or not we have an error with the decoder. | Generators/SoundWaveScrubber.h | |
| bIsScrubbing | bool | Whether or not we're actively scrubbing audio playback. | Generators/SoundWaveScrubber.h | |
| bIsScrubbingDueToBeingStationary | bool | Generators/SoundWaveScrubber.h | ||
| bIsScrubbingWhileStationary | bool | Whether or not we scrub while the playhead doesn't move. | Generators/SoundWaveScrubber.h | |
| CritSect | FCriticalSection | Used for setting user parameters. | Generators/SoundWaveScrubber.h | |
| CurrentGrainDurationFrames | int32 | Grain duration as computed by scrub velocity based on the grain duration ranges. | Generators/SoundWaveScrubber.h | |
| CurrentHalfGrainDurationFrames | int32 | Generators/SoundWaveScrubber.h | ||
| CurrentPlayheadTimeSeconds | FDynamicParameter | Interpolated playhead time. | Generators/SoundWaveScrubber.h | |
| DecodedChunks | TArray< FDecodedDataChunk > | Place to store decoded chunks. We need 2 chunks for actively playing grains plus a free chunk. | Generators/SoundWaveScrubber.h | |
| GrainCount | int32 | Utility data useful for debugging the scrubber. | Generators/SoundWaveScrubber.h | |
| GrainDurationRange | FVector2D | Generators/SoundWaveScrubber.h | ||
| GrainDurationSeconds | float | Generators/SoundWaveScrubber.h | ||
| GrainEnvelope | Audio::Grain::FEnvelope | Data for granulation Envelope shared across grains | Generators/SoundWaveScrubber.h | |
| NumActiveGrains | int32 | This should never go above 2. | Generators/SoundWaveScrubber.h | |
| NumChannels | int32 | Generators/SoundWaveScrubber.h | ||
| NumFramesTillNextGrainSpawn | int32 | This is a frame count until we need to spawn another grain. | Generators/SoundWaveScrubber.h | |
| SoundWaveProxyPtr | FSoundWaveProxyPtr | Sound wave proxy to safely query and use the referenced sound wave asset. | Generators/SoundWaveScrubber.h | |
| SoundWaveProxyReaderPtr | TUniquePtr< FSoundWaveProxyReader > | Sound wave proxy reader is a decoder we can use to decode audio into chunks. | Generators/SoundWaveScrubber.h | |
| SourceFileDurationSeconds | float | Generators/SoundWaveScrubber.h | ||
| SourceFileSampleRate | float | Generators/SoundWaveScrubber.h | ||
| SRC | TUniquePtr< Audio::ISampleRateConverter > | Simple SRC interface. Decoded audio is SRC'd to match the audio mixer sample rate. | Generators/SoundWaveScrubber.h | |
| TargetGrainDurationRange | FVector2D | The grain duration in frames. | Generators/SoundWaveScrubber.h | |
| TargetPlayheadTimeSeconds | float | The current target playhead time in seconds The scrubber will interpolate to this if the current playhead time is less than a given threshold, otherwise the scrubber will "jump" to the playhead time. | Generators/SoundWaveScrubber.h | |
| TimeSincePlayheadHasNotChanged | float | How long we've been stationary. | Generators/SoundWaveScrubber.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Init
(
FSoundWaveProxyPtr InSoundWaveProxyPtr, |
Initialize the sound wave scrubber. | Generators/SoundWaveScrubber.h | |
int32 RenderAudio
(
TArrayView< float >& OutAudio |
Renders the audio from the sound wave scrubber into the output audio buffer. | Generators/SoundWaveScrubber.h | |
void SetGrainDurationRange
(
const FVector2D& InGrainDurationRange |
Sets the grain duration range in seconds (clamped in range of of 0.01 to 0.5 seconds) The grain duration used during grain spawn is based the scrubbing speed. | Generators/SoundWaveScrubber.h | |
void SetIsScrubbing
(
bool bInIsScrubbing |
Sets whether or not to scrub the audio file. If false, then the output of the scrubber will be silence. | Generators/SoundWaveScrubber.h | |
void SetIsScrubbingWhileStationary
(
bool bInIsScrubWhileStationary |
Sets if the scrubber should scrub while playhead is stationary (after it hits it's target playhead) | Generators/SoundWaveScrubber.h | |
void SetPlayheadTime
(
float InPlayheadTimeSeconds |
Sets the scrubbing location in seconds. | Generators/SoundWaveScrubber.h |