API reference
Preparing search index…

SoundRecorder

Capture device audio and process interleaved 16-bit PCM in a Node Worker.

Type hierarchy

Hierarchy (View Summary)

Source & inheritance
Member directory14

Constructors

Methods

Constructors

Methods

  • Return the speaker position mapping of the capture channels.

    Returns

    Readonly
    Source & inheritance
  • Return the first Worker or subclass callback error, or undefined if none.

    Returns

    undefined | Error
    Source & inheritance
  • Set the capture channel count; wait for the current asynchronous recording operation to finish before calling.

    Parameters

    count
    number

    Returns

    void
    Source & inheritance
  • Asynchronously switch recording devices and return whether it succeeded. Runs in invocation order; must not be called from subclass callbacks.

    Parameters

    name
    string

    Returns

    Promise<boolean>
    Source & inheritance
  • Asynchronously initialize capture, defaulting to 44100 Hz; return false if already capturing, rejected, or startup fails. Do not restart from subclass callbacks; await stop() externally before starting the next session.

    Parameters

    sampleRate
    number = 44100

    Returns

    Promise<boolean>
    Source & inheritance
  • Asynchronously stop capture and await remaining samples and onStop. Inside subclass callbacks, await stop() only waits for the device to stop, avoiding a self-wait. Draining continues after the callback exits; await stop() again externally to wait for full completion.

    Returns

    Promise<void>
    Source & inheritance
  • Return the names of currently available recording devices.

    Returns

    string[]
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0