Renders a short tone to a data:audio/wav URI, ready to hand to an Audio element (or any other Playable source) without touching the network or mwg/assets - nothing here is loaded, only computed.
data:audio/wav
Audio
Playable
mwg/assets
import { synthesizeTone } from '@datamoc/mw_games/audio';const dataUri = synthesizeTone({ waveform: 'square', frequency: 880, duration: 0.1 });const audio = new Audio(dataUri); Copy
import { synthesizeTone } from '@datamoc/mw_games/audio';const dataUri = synthesizeTone({ waveform: 'square', frequency: 880, duration: 0.1 });const audio = new Audio(dataUri);
Renders a short tone to a
data:audio/wavURI, ready to hand to anAudioelement (or any otherPlayablesource) without touching the network ormwg/assets- nothing here is loaded, only computed.