Audio & SFX
Playing Ambient Audio
startServer(world => {
// ... Rest of our game setup code
const gameMusic = new Audio({
uri: 'audio/music/ambience.mp3',
loop: true, // Loop the music when it ends
volume: 0.5, // Relative volume 0 to 1
});
gameMusic.play(world); // Play the music in our world
// ... More game setup code, ordering doesn't matter for Audio
})Playing Spatial Audio
Controlling Playback & Effects
Diving Deeper
Next Steps
Last updated
