mwg API
    Preparing search index...

    Function synthesizeTone

    • 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.

      Parameters

      Returns string

      import { synthesizeTone } from '@datamoc/mw_games/audio';

      const dataUri = synthesizeTone({ waveform: 'square', frequency: 880, duration: 0.1 });
      const audio = new Audio(dataUri);