API reference

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

C

classAudioGenerator

@codexo/exojs / audio / stable

Procedural tone generator - produces audio from an `OscillatorNode` without any decoded asset. Good for prototyping, game-jam SFX, retro bleeps, and synth-style tones. `AudioGenerator` is a **data descriptor**: it holds the current synth settings (`frequency`, `type`, `detune`, `envelope`) and default playback parameters. Each `AudioSystem.play(generator, options)` snapshots those settings into a fresh AudioGeneratorVoice and returns it. For per-note playback, set `generator.frequency` (or use AudioGenerator.setNote) before playing: ```ts generator.setNote(69); // A4 const voice = app.audio.play(generator); // ...later voice.frequency = 880; // retune the live voice voice.stop(); // triggers the envelope release, if any ``` Routes through the system's `sound` bus by default.

9
props
5
methods
0
events
Import
import { AudioGenerator } from '@codexo/exojs'

Procedural tone generator - produces audio from an `OscillatorNode` without any decoded asset. Good for prototyping, game-jam SFX, retro bleeps, and synth-style tones.

`AudioGenerator` is a **data descriptor**: it holds the current synth settings (`frequency`, `type`, `detune`, `envelope`) and default playback parameters. Each `AudioSystem.play(generator, options)` snapshots those settings into a fresh AudioGeneratorVoice and returns it. For per-note playback, set `generator.frequency` (or use AudioGenerator.setNote) before playing:

```ts generator.setNote(69); // A4 const voice = app.audio.play(generator); // ...later voice.frequency = 880; // retune the live voice voice.stop(); // triggers the envelope release, if any ```

Routes through the system's `sound` bus by default.

Constructors1
Methods5
Implements Playable. Called by AudioSystem.play. Snapshots the current synth settings into a new AudioGeneratorVoice. Returns an already-ended NoopVoice when the AudioContext is still locked by the autoplay policy - oscillators are ephemeral and cannot be deferred.
destroy(): void
Stop all active voices.
setNote(midiNote: number): this
Set AudioGenerator.frequency from a MIDI note number (69 = A4 = 440 Hz).
stopAll(): this
Stop every currently active voice from this generator.
midiToFrequency(midiNote: number): number
Frequency in Hz for a MIDI note number, without mutating the generator.
Properties9
detune: number
Current pitch detune in cents.
frequency: number
Current oscillator frequency in Hz. Snapshotted into each new voice.
muted: boolean
Default muted flag (starts a voice at volume 0).
priority: number
Priority for the LowestPriority eviction strategy.
Current oscillator waveform.
volume: number
Default volume for new voices. Range [0, 1].
poolSize: number
Source