@twilio/video-node-sdk - v1.0.0-rc.3
    Preparing search index...

    Interface LocalAudioTrack

    A local audio track that the application feeds with PCM samples. Create via createLocalAudioTrack.

    interface LocalAudioTrack {
        enabled: boolean;
        kind: "audio";
        name: string;
        clearBuffer(): void;
        getWriteStats(): WriteStats;
        write(frame: AudioFrameInput): boolean;
    }
    Index
    enabled: boolean

    Whether the track is enabled; setting false publishes silence without unpublishing.

    kind: "audio"

    Always 'audio'.

    name: string

    Track name, unique across the local participant's published tracks.

    • Drop any buffered, not-yet-sent audio samples. Use to discard stale audio before resuming.

      Returns void

    • Push a PCM audio frame into the track.

      Format is fixed at 48 kHz mono S16LE — AudioFrameInput exposes no sampleRate/channels fields, and pcm is interpreted as int16 mono samples.

      Samples are copied synchronously, so the caller may reuse or free pcm as soon as this returns.

      Throws TypeError/RangeError on invalid input (missing/non-Buffer pcm, non-integer frames, pcm shorter than frames, non-numeric timestamp). Throws Error if the track is not bound to a source.

      Returns true when the samples were enqueued, false when they did not fit in the bounded publish queue. A rejected write buffers nothing, so a write is never partially published; a single write larger than source.maxQueue can never fit. Every false is counted in LocalAudioTrack.getWriteStats.

      timestamp is observability-only on this path: audio publish is FIFO, so it feeds WriteStats.lastTimestamp and WriteStats.timestampRegressions without changing what is sent.

      Parameters

      Returns boolean