mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.09k stars 35.42k forks source link

Audio cannot be started muted #29764

Closed trekar99 closed 1 month ago

trekar99 commented 1 month ago

Description

My program requires multiple audios to start at the same time at startup, so that they are synchronized, but I need to start them muted. The problem is that they play for a fraction of a second when starting them this way, preventing it from being an initial mute.

Reproduction steps

// Set mute for(const sound of sounds) sound.setVolume(0)

// Loop for(const sound of sounds) sound.loop = true

// Play song for(const sound of sounds) sound.play()

Code

// Set mute
for(const sound of sounds) sound.setVolume(0)

// Loop
for(const sound of sounds) sound.loop = true

// Play song
for(const sound of sounds) sound.play()

Live example

https://daftpunkins.vercel.app/

Screenshots

No response

Version

0.166.1

Device

No response

Browser

No response

OS

No response

Mugen87 commented 1 month ago

Please ask at the forum for help.