Class VirtualAudioWriter
- Namespace
- VisioForge.Core.VirtualCamera.Push
- Assembly
- VisioForge.Core.dll
Pushes raw PCM audio samples to the VisioForge Virtual Audio Card via shared memory, bypassing DirectShow completely. The virtual audio card source filter reads these samples and presents them as a microphone input to consumer applications.
public sealed class VirtualAudioWriter : IDisposableInheritance
Implements
Inherited Members
Constructors
VirtualAudioWriter(int, int, int, string, BaseContext)
Creates a new virtual audio writer.
public VirtualAudioWriter(int sampleRate, int channels, int bitsPerSample, string streamName, BaseContext context)Parameters
sampleRateint-
Sample rate in Hz (e.g., 48000).
channelsint-
Number of channels (1=mono, 2=stereo).
bitsPerSampleint-
Bits per sample (typically 16).
streamNamestring-
Shared memory stream name. Default matches the virtual audio card filter.
contextBaseContext-
SDK logging context. May be null (falls back to Trace).
Properties
BytesWritten
Total bytes of audio data pushed since Start().
public long BytesWritten { get; }Property Value
Methods
Dispose()
Releases all resources used by the VisioForge.Core.VirtualCamera.Push.VirtualAudioWriter, sending an EOS signal to the virtual audio card before closing shared memory.
public void Dispose()PushSamples(ReadOnlySpan<byte>)
Pushes raw PCM audio data. Size must be a multiple of blockAlign (channels * bitsPerSample / 8). Timestamps are calculated automatically based on accumulated bytes.
public bool PushSamples(ReadOnlySpan<byte> pcmData)Parameters
pcmDataReadOnlySpan<byte>
Returns
Start()
Opens shared memory and signals that streaming is starting. Must be called before PushSamples.
public void Start()Stop()
Signals end of stream and stops writing.
public void Stop()