Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Any tips why do I have slowdowns of music in WebGL?

Discussion in 'WebGL' started by scorched, Aug 25, 2015.

  1. scorched

    scorched

    Joined:
    Jan 1, 2013
    Posts:
    4
    The same game in Windows plays back music just fine, but in WebGL when I walk (arrow keys) I get slowdowns.

    Play Windows
    Play WebGL
    sources: https://github.com/starry-abyss/yeti

    Tried different Audioclip import settings - didn't help. Using Firefox.
    Updated to Unity 5.1.3 - didn't help either
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    The way that moving around changes the pitch of the sound indicates that there is some bug in WebGL doppler effect simulation. This is possible, as WebGL uses different code for audio then other platforms. I'm not aware of any current issues in WebGL doppler effect simulation (but there have been some in the past). If you file a bug report with a project folder (and quote the case number here), I'm sure we can find a fix quickly.
     
  3. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    188
    use .ogg format. Jonas was problem: not loading sounds from bundle.. don't know it fixed or no
     
  4. scorched

    scorched

    Joined:
    Jan 1, 2013
    Posts:
    4
    I used it from the beginning...
     
  5. scorched

    scorched

    Joined:
    Jan 1, 2013
    Posts:
    4
    Done. The case number is: 722766
     
  6. MonsterBed_gs

    MonsterBed_gs

    Joined:
    Sep 19, 2012
    Posts:
    11
    Any news? How can I track this issue? I am having the same problem...
     
  7. MonsterBed_gs

    MonsterBed_gs

    Joined:
    Sep 19, 2012
    Posts:
    11
  8. AnonDreamer

    AnonDreamer

    Joined:
    Oct 28, 2014
    Posts:
    30
    Hi, i had the same issue on webGL builds when playing sounds and having the camera move at the same time.

    I found a fix, put the "doppler level" of the audiosource linked to the sound, to the value of 0, i hope this helps :s
     
  9. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    FYI, we found the source of this issue (Doppler effect simulation is not correctly disabled when setting "spatial blend" to 0 on WebGL). This will be fixed in 5.3, until then, the workaround described by @AnonDreamer is fine.