Assets/Plugins/Unity.DSPGraph/Runtime/DSPGraph.cs
/// <summary>
/// Read the samples from the mix. Always call after BeginMix.
/// </summary>
/// <remarks>This method will be bursted if the owning IAudioOutputJob is decorated with BurstCompileAttribute</remarks>
/// <param name="buffer">A Float array of the samples</param>
/// <param name="frameCount">The number of frames to read</param>
/// <param name="channelCount">The number of channels to read</param>
Read the samples from the mix. Always call after BeginMix.
Read the samples from the mix . Always call after BeginMix .
public void ReadMix(NativeArray<float> buffer, int frameCount, int channelCount)
        {
            ValidateBufferSize(buffer, frameCount, channelCount);
            if (frameCount != LastReadLength)
                throw new InvalidOperationException($"Incompatible buffer passed to ReadMix, buffer of size {frameCount * channelCount} does not match previous read length {LastReadLength * channelCount}");
            ProfilerMarkers.ReadMixMarker.Begin();
            SyncPreviousMix();
            UnsafeUtility.MemCpy(buffer.GetUnsafePtr(), *(float**)m_RootBuffer.Data, frameCount * channelCount * UnsafeUtility.SizeOf<float>());
            ProfilerMarkers.ReadMixMarker.End();
        }
public void ReadMix ( NativeArray < float > buffer , int frameCount , int channelCount ) { ValidateBufferSize ( buffer , frameCount , channelCount ) ; if ( frameCount != LastReadLength ) throw new InvalidOperationException ( $" Incompatible buffer passed to ReadMix, buffer of size  { frameCount * channelCount }  does not match previous read length  { LastReadLength * channelCount } " ) ; ProfilerMarkers . ReadMixMarker . Begin ( ) ; SyncPreviousMix ( ) ; UnsafeUtility . MemCpy ( buffer . GetUnsafePtr ( ) , * ( float * * ) m_RootBuffer . Data , frameCount * channelCount * UnsafeUtility . SizeOf < float > ( ) ) ; ProfilerMarkers . ReadMixMarker . End ( ) ; }
Read the samples from the mix.
Read the samples from the mix .
buffer
NativeArray<float>
A Float array of the samples
A Float array of the samples
frameCount
int
The number of frames to read
The number of frames to read
channelCount
int
The number of channels to read
The number of channels to read
remarks
This method will be bursted if the owning IAudioOutputJob is decorated with BurstCompileAttribute
This method will be bursted if the owning IAudioOutputJob is decorated with BurstCompileAttribute