public sealed class CaptureSampleProviderA microphone, as something the mixer can play.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Monitoring: engine.Play(new CaptureSampleProvider(microphone), settings) and the player hears themselves, through whatever bus that is routed to and therefore through whatever gate, compressor and filter is on it. Which is how somebody sets a gate threshold without a second machine and a friend.
An empty microphone is silence and a counter, not the end of the sound. Exactly as LiveSampleProvider treats a late packet — somebody who has stopped talking has not left, and a voice that ended on every gap would be rebuilt, with its bus and its spatialisation, several times a sentence.
It does not own the device. A microphone usually outlives any one thing listening to it, and the voice-chat encoder is generally reading the same device — so disposing it here because a monitoring voice ended would take the session's input with it.
Fields and properties (5)
public AudioFormat FormatThe rate and channel count of what Read produces.
public long FrameCountpublic long PositionWhere the next Read will start, in frames.
public bool IsLoopingWhether it will keep producing after it has run out.
public long StarvedHow many frames of silence were produced because the microphone had nothing.
Methods (3)
public CaptureSampleProvider(IAudioCaptureDevice device)A microphone, as something the mixer can play.
public int Read(Span<float> destination, int frameCount)Produces the next frames.
public void Seek(long frame)
Used by (2)
- CaptureTestsVixen.Audio.Tests
- LayeredEventTestsVixen.Audio.Tests