API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAudioInput

@codexo/exojs / audio / stable

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.

1
props
2
methods
0
events
Import
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.

Methods2
destroy(): void
Stop every track in the stream, releasing the input device. Idempotent.
Request microphone access and resolve with an AudioInput. Throws AudioUnsupportedError when the environment has no getUserMedia at all. When the API exists but the request fails, the browser's own DOMException is passed through unwrapped - its name (NotAllowedError for a denied permission, NotFoundError for a missing device) is the standard signal to branch on and is not worth hiding behind an engine class.
Properties1
stream: MediaStream
The underlying MediaStream.
Source