mwg API
    Preparing search index...

    Function synthesizeSound

    • A pooled Sound playing a synthesized tone: synthesizeTone and Sound composed, for the common case of a procedural effect that must overlap itself.

      Parameters

      Returns Sound

      import { synthesizeSound } from '@datamoc/mwg/audio';

      const blip = synthesizeSound({ waveform: 'square', frequency: 660, duration: 0.08 }, { poolSize: 6 });
      blip.play(1, 0.9 + Math.random() * 0.2); // a little pitch variance per hit