mwg API
    Preparing search index...

    Function createAudio

    • The real thing: an HTMLAudioElement pointed at a resolved asset path.

      Parameters

      • path: string

      Returns Playable

      import { createAudio, Sound } from '@datamoc/mw_games/audio';

      // Sound/Music both default to this; supply your own only for a test or a non-browser backend
      const hit = new Sound('sounds/hit.mp3', { create: createAudio });