Vixen
02b45cc4
csharp
public interface IAudioCaptureDevice

An open microphone.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Pull, like everything else here, and for the opposite reason. An output device pulls because the hardware asks; a capture device is pulled because the thing that wants the audio — an encoder, a voice-chat client, a recorder — is on the game thread and knows when it can take some. Between the two sits a ring the platform fills, so a game thread that runs long loses nothing.

It is not an IAudioDevice. The two share almost nothing: one has a render source and buffer counts, the other has an overrun counter and a read. Merging them would produce a type half of whose members throw on any given instance.

Wrap one in CaptureSampleProvider to hear it — which is monitoring, and also the only way to test the path end to end.

Fields and properties (5)

  • AudioDeviceInfo Info

    Which device this is.

  • AudioFormat Format

    The format it was actually opened in.

  • bool IsRunning

    Whether it is currently capturing.

  • int Available

    How many frames are waiting to be read.

  • long Overruns

    How many frames were thrown away because nobody read them in time.

Methods (3)

  • void Start()

    Starts capturing. Anything captured before the first Read is buffered.

  • void Stop()

    Stops capturing. Starting again is legal.

  • int Read(Span<float> destination, int frameCount)

    Takes what has been captured.

Used by (7)

  • CaptureSampleProviderVixen.Audio
  • CaptureTestsVixen.Audio.Tests
  • IAudioBackendVixen.Audio
  • NullAudioBackendVixen.Audio
  • NullAudioCaptureDeviceVixen.Audio
  • OpenALBackendVixen.Audio.Backend.OpenAL
  • OpenALCaptureDeviceVixen.Audio.Backend.OpenAL