Edgewise API
    Preparing search index...

    Interface Mic

    A live audio source, such as the one mic() returns.

    interface Mic {
        kind: "audio-source";
        level: number;
        recording: boolean;
        sampleRate: number;
        speaking: boolean;
        speechProbability: number;
        dispose(): void;
        start(): Promise<void>;
        stop(): Promise<Float32Array<ArrayBufferLike>>;
        toBlob(type?: string): Promise<Blob>;
        utterances(): AsyncIterable<Float32Array<ArrayBufferLike>>;
    }

    Hierarchy (View Summary)

    Index
    kind: "audio-source"
    level: number

    Current input level, 0 to 1.

    recording: boolean
    sampleRate: number
    speaking: boolean

    With VAD, while utterances() is being read: true from the moment speech starts until its utterance ends.

    speechProbability: number

    With VAD: the latest speech probability, 0 to 1.

    • Release the microphone.

      Returns void

    • Start recording (push to talk).

      Returns Promise<void>

    • Stop and return everything recorded since start().

      Returns Promise<Float32Array<ArrayBufferLike>>

    • Record a compressed copy with MediaRecorder.

      Parameters

      • Optionaltype: string

      Returns Promise<Blob>

    • Yields one Float32Array per utterance (with VAD) or per chunk (without).

      Returns AsyncIterable<Float32Array<ArrayBufferLike>>