Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The sound does not play on a mobile device on the HTML platform. #8114

Closed
megalanthus opened this issue Oct 8, 2023 · 5 comments
Closed
Labels
bug Something is not working as expected html5 Issue related to the HTML5 platform input Issues related to user input more info The issue is lacking required information sound Issues related to sound handling

Comments

@megalanthus
Copy link

Expected behaviour

When starting a sound, the sound is not played on a mobile device on the HTML platform.

Actual behaviour

If the sound starts playing after a click and a pause of 0.5 seconds, then it plays normally.

Steps to reproduce

Test project attached
sound_bug.zip

Note

image
console:
not_working

Workaround:
image
console:
working


Build time2023-10-06T10:03:05.754106
Defold channeleditor-alpha
Defold editor sha3584a33
Defold engine shad9e9c49
Defold version1.6.0
GPUNVIDIA GeForce GTX 1060 3GB/PCIe/SSE2
GPU Driver4.6.0 NVIDIA 536.23
Java version17.0.5+8
OS archamd64
OS nameWindows 10
OS version10.0
@britzl
Copy link
Contributor

britzl commented Oct 9, 2023

I believe the input has to be fully processed by the engine AND the browser before you are allowed to play sounds.

What if you do it on action.released? The only other option is to add a timer, or take a look at defos.on_interaction() / defos.on_click() (https://github.com/subsoap/defos)

@britzl britzl added bug Something is not working as expected more info The issue is lacking required information input Issues related to user input sound Issues related to sound handling html5 Issue related to the HTML5 platform labels Oct 9, 2023
@megalanthus
Copy link
Author

I believe the input has to be fully processed by the engine AND the browser before you are allowed to play sounds.

What if you do it on action.released? The only other option is to add a timer, or take a look at defos.on_interaction() / defos.on_click() (https://github.com/subsoap/defos)

The thing is that the sound is not played not only that was launched first, but also any other sounds! Absolutely everything in the entire project! Another question arises, why does this not happen on a desktop PC?
Versions 1.5 and below do not have this problem. Yes, there is a click if the sound is started before the user takes action, but the sound is guaranteed to work!

I tried playing the sound after action.released and everything works as expected. But there are still some doubts about whether in this case it is guaranteed to work for everyone and everywhere?

@Insality
Copy link
Sponsor

The same issue

I updated the game from 1.5.0 to the 1.6.0 Defold version and sounds are not playing in mobile HTML
Rollback to 1.5.0 - sounds are good and playing

@britzl
Copy link
Contributor

britzl commented Oct 11, 2023

@AGulev
Copy link
Contributor

AGulev commented Oct 12, 2023

fixed in beta with #8140
Should be available in 1.6.1 beta in 1-2h

@AGulev AGulev closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected html5 Issue related to the HTML5 platform input Issues related to user input more info The issue is lacking required information sound Issues related to sound handling
Projects
None yet
Development

No branches or pull requests

4 participants