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

Sped up audio on the web in the first seconds #27

Open
yopox opened this issue Oct 17, 2021 · 5 comments
Open

Sped up audio on the web in the first seconds #27

yopox opened this issue Oct 17, 2021 · 5 comments

Comments

@yopox
Copy link

yopox commented Oct 17, 2021

On the web build of my game, the audio is sped up in the first few seconds on Vivaldi.

Steps to reproduce:

  • Run game (itch.io)
  • Click on the game during the grey loading screen to enable audio
  • On the title screen the music will be sped up for a few seconds

I have used bevy_asset_loader to load my BGMs and SFXs in another state.
In the title state, Handle<AudioSource>-s should be ready and I just call audio.play_looped(songs.title.clone()); on state enter. (loading, audio played)

@NiklasEi
Copy link
Owner

NiklasEi commented Oct 17, 2021

I have observed that, too. So far I thought this is a general problem of this plugin in the browser (see #9). I have never noticed it in a native build.
The handle being loaded or not does not make a difference I think. The audio will just start playing later.

I will see if bevy_audio has the same issue.

@NiklasEi
Copy link
Owner

NiklasEi commented May 5, 2022

I have observed this less with Bevy 0.7, is it also better for you now?

@shnewto
Copy link

shnewto commented May 13, 2022

I'm seeing something that seems related (Bevy 0.7). The first few seconds of my audio are "crackly" before stabilizing. Seems to be the case in Chrome, Firefox, and Safari 🤔. It does seem to be performance related... if I don't setup a camera, so there's nothing for the browser to render, the audio plays fine.

Here's the branch where I'm experimenting https://github.com/shnewto/limbo_pass/tree/wasm-kira

@shnewto
Copy link

shnewto commented May 14, 2022

Haven't found the culprit but exploring it did take me into kira and cpal... I saw that the bevy_audio crate's rodio dependency is using the same version of cpal as kira so tested with bevy_audio and the crunch/crackling isn't present 🤔

edit: I missed that you checked bevy_audio already and this isn't news 🙃

edit 2: I've been unable to reproduce the things I thought I was seeing when I used rodio, today using rodio the audio is still plenty crackly.

@yopox
Copy link
Author

yopox commented Jan 9, 2023

The problem still occurs with bevy 0.9 and bevy_kira_audio 0.13.0 (example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants