Interface IAudioOutput
Output job for a DSPGraph
Namespace: Unity.Audio
Syntax
[JobProducerType(typeof(AudioOutputExtensions.AudioOutputHookStructProduce<>))]
public interface IAudioOutput
Remarks
It's important to mark audio output jobs for synchronous burst compilation when running in the Unity editor. Otherwise, they can be executed via mono until burst compilation finishes, which will make the audio mixer thread subject to pausing for garbage collection for the rest of the Unity session.
Methods
BeginMix(Int32)
Called to prompt the user to begin a mix
Declaration
void BeginMix(int frameCount)
Parameters
Type | Name | Description |
---|---|---|
Int32 | frameCount | The number of frames per channel to mix |
Dispose()
Called to prompt the user to dispose any resources
Declaration
void Dispose()
EndMix(NativeArray<Single>, Int32)
Called to prompt the user to write mixing output
Declaration
void EndMix(NativeArray<float> output, int frames)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<Single> | output | Mixing output should be written here |
Int32 | frames | The number of frames per channel to be written |
Initialize(Int32, SoundFormat, Int32, Int64)
Called to allow the user to initialize an audio output
Declaration
void Initialize(int channelCount, SoundFormat format, int sampleRate, long dspBufferSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | channelCount | The channel count for the output |
SoundFormat | format | The format of the output buffer |
Int32 | sampleRate | The sample rate for the output in Hz |
Int64 | dspBufferSize | The buffer size for the output in samples per channel |