API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAudioGenerator
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.
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.
new(options: AudioGeneratorOptionsConstruction options for AudioGenerator.): AudioGeneratorcreateVoice(system: AudioSystemPer-Application owner of the audio mix: three pre-configured AudioBus instances (`master` ← `music` + `sound`), a single AudioListener for spatial audio, and a…, options: PlayOptionsPer-play overrides passed to AudioSystem.play.): VoiceA live playback instance in the audio graph with a control surface. A Voice is created by playing a Playable via AudioSystem.play (and, later, by opening an `A…destroy(): voidsetNote(midiNote: number): thisstopAll(): thismidiToFrequency(midiNote: number): numberdetune: numberfrequency: numbermuted: booleanpriority: numbertype: OscillatorTypevolume: numberpoolSize: number