From 626c0645346705111505c8d5d0abab5607b22fe3 Mon Sep 17 00:00:00 2001 From: Timothy Hale Date: Wed, 28 Feb 2024 17:11:17 +0100 Subject: [PATCH] update README --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 18b12ae..86816a8 100644 --- a/README.md +++ b/README.md @@ -48,18 +48,17 @@ If `spatial` is set to `none`, all settings below are ignored. ```js // Load your audio on start(), so it is ready when you need it. start() { - this.audio = globalAudioManager.load('path_to_audiofile') - .then((playableNode) => { - return playableNode; + globalAudioManager.load('audio.mp3').then((playableNode) => { + this.click = playableNode; }); } // Play the file when you need it. onClick() { - // Play's the audio without panning + // Plays the audio without panning this.audio.play(); - const position: Float32Array = new Float32Array(3); + const position = new Float32Array(3); this.object.getPositionWorld(position); // Play's from specified position relative to audio-listener this.audio.play(position);