FreakingGenius - v0.1.0
    Preparing search index...

    Class AudioCapture

    Manages microphone access and streams raw PCM audio to a registered handler.

    const capture = new AudioCapture({ sampleRateHz: 16_000, chunkFrames: 1024 });
    capture.onChunk((pcm) => vad.feed(pcm));
    await capture.start();
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Returns true if the microphone stream is currently live.

      Returns boolean

      true when capturing, false when stopped or not yet started.

    • Requests microphone permission, opens the audio stream, and begins emitting PCM chunks to the registered callback.

      Returns Promise<void>

      Resolves once the stream is live and chunks will be emitted.

      If the user denies microphone permission.

    • Stops the audio stream and releases the microphone device so other browser tabs can acquire it.

      Returns Promise<void>

      Resolves once the stream is fully torn down.