Options
All
  • Public
  • Public/Protected
  • All
Menu

General interface for any audio capture subsystem, user-implementable.

Events:

  • data(Float32Array[]): Audio data event. Each element of the array is a single channel of audio data.
  • vad(null): Audio VAD change event. Fired every time the VAD status changes.

Hierarchy

Index

Constructors

constructor

Methods

Abstract close

  • close(): void
  • Stop this audio capture and remove any underlying data.

    Returns void

emitEvent

  • emitEvent(ev: string, arg: any): void
  • Emit this event.

    Parameters

    • ev: string

      Event name to emit.

    • arg: any

      Argument to the event handler(s).

    Returns void

Abstract getSampleRate

  • getSampleRate(): number
  • Get the sample rate of this capture. Must never change.

    Returns number

getVADState

off

on

  • Set an event handler.

    Parameters

    • ev: string

      Event name, or "*" for all events.

    • handler: EventHandler

      Event handler for this event.

    Returns void

once

  • Set a one-time event handler.

    Parameters

    • ev: string

      Event name, or "*" for all events.

    • handler: EventHandler

      Event handler for this event.

    Returns void

pipe

  • pipe(to: MessagePort): void
  • Redirect data to this MessagePort. This may suppress all future "data" messages, or may not.

    Parameters

    • to: MessagePort

    Returns void

tee

  • "Tee" this capture into the number of receivers specified.

    Parameters

    • ct: number

      Number of duplicates to make.

    Returns AudioCapture[]

Generated using TypeDoc