The real thing: an HTMLAudioElement pointed at a resolved asset path.
HTMLAudioElement
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 backendconst hit = new Sound('sounds/hit.mp3', { create: createAudio }); Copy
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 backendconst hit = new Sound('sounds/hit.mp3', { create: createAudio });
The real thing: an
HTMLAudioElementpointed at a resolved asset path.