Files
sbox-public/engine/Sandbox.Engine/Systems/Audio/Dsp/DspInstance.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

33 lines
681 B
C#

namespace Sandbox.Audio;
/// <summary>
/// An instance of a DspPreset. The actual processor creates one of these from
/// a DspPreset, and then uses it to process the audio buffers.
/// </summary>
class DspInstance
{
global::DspInstance _native;
internal DspInstance( DspPreset source, int channels )
{
_native = source.GetNative().Instantiate( channels );
}
~DspInstance()
{
MainThread.QueueDispose( _native );
}
public void Process( MixBuffer input, MixBuffer output, int channel )
{
_native.ProcessChannel( input._native, output._native, channel );
}
internal void Dispose()
{
GC.SuppressFinalize( this );
MainThread.QueueDispose( _native );
}
}