Skip to content

API Interface AudioCapture

github-actions[bot] edited this page Nov 29, 2026 · 3 revisions

Interface: AudioCapture

Defined in: src/plugins/audio/runtime/capture/capture.ts:65

Audio.capture (§1.2).

Properties

bytes

readonly bytes: number;

Defined in: src/plugins/audio/runtime/capture/capture.ts:70


seconds

readonly seconds: number;

Defined in: src/plugins/audio/runtime/capture/capture.ts:69

The ring's content, seconds; 0 while idle.


state

readonly state: AudioCaptureState;

Defined in: src/plugins/audio/runtime/capture/capture.ts:67

"idle" -> "loading" (recorder chunk fetching) -> "recording" -> "stopped" (a take exists to save).


truncated

readonly truncated: boolean;

Defined in: src/plugins/audio/runtime/capture/capture.ts:72

True when the ring wrapped over the take's start: the file begins at a later keyframe and is marked truncated.

Methods

mark()

mark(text): void;

Defined in: src/plugins/audio/runtime/capture/capture.ts:78

A timeline marker at the current frame, cut to CAPTURE_MARKER_MAX_BYTES (120) UTF-8 bytes. No-op while no ring runs.

Parameters

text

string

Returns

void


save()

save(name?): Promise<string>;

Defined in: src/plugins/audio/runtime/capture/capture.ts:80

Compress and save the take; resolves with the web file name or the app-data path. Rejects with "nothing recorded: call Audio.capture.start() first" when there is no take.

Parameters

name?

string

Returns

Promise<string>


start()

start(): Promise<void>;

Defined in: src/plugins/audio/runtime/capture/capture.ts:74

Load the recorder (a lazy chunk) and begin a take. Resolves once recording; rejects with a message if the chunk or the core is unavailable. A second call while recording joins it, writes a marker and resolves at once.

Returns

Promise<void>


stop()

stop(): void;

Defined in: src/plugins/audio/runtime/capture/capture.ts:76

End the caller's hold. The ring keeps recording while the Profiler panel is open (one ring, shared).

Returns

void

Clone this wiki locally