API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAudioInput
A live audio capture source - a microphone or WebRTC `MediaStream` obtained via `getUserMedia`. **Not a Playable**: you don't "play" a mic, you *open* it. Pass it to AudioSystem.open to get an InputVoice for monitoring, analysis, or recording. ```ts const mic = await AudioInput.open({ echoCancellation: true }); const input = app.audio.open(mic); new AudioAnalyser({ source: input }); // visualise / beat-detect (no feedback) const clip = await input.record(2000); // capture 2s -> Sound mic.destroy(); // release the device ``` open is a static factory, so it has no `close()` counterpart: teardown goes through destroy like every other owned resource in the engine, which also makes an `AudioInput` trackable by a DestroyScope.
import { AudioInput } from '@codexo/exojs'A live audio capture source - a microphone or WebRTC `MediaStream` obtained via `getUserMedia`. **Not a Playable**: you don't "play" a mic, you *open* it. Pass it to AudioSystem.open to get an InputVoice for monitoring, analysis, or recording.
```ts const mic = await AudioInput.open({ echoCancellation: true }); const input = app.audio.open(mic); new AudioAnalyser({ source: input }); // visualise / beat-detect (no feedback) const clip = await input.record(2000); // capture 2s -> Sound mic.destroy(); // release the device ```
open is a static factory, so it has no `close()` counterpart: teardown goes through destroy like every other owned resource in the engine, which also makes an `AudioInput` trackable by a DestroyScope.
destroy(): voidopen(options: AudioInputOptionsOptions for AudioInput.open - forwarded to `getUserMedia` audio constraints.): Promise<AudioInput>stream: MediaStream