Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio WebGL Question

Discussion in 'Unity 5 Pre-order Beta' started by astronaut_tim, Nov 19, 2014.

  1. astronaut_tim

    astronaut_tim

    Joined:
    Apr 18, 2014
    Posts:
    7
    Hi,

    I posted this to the unity support forum but later discovered that there is this Unity5 Beta Forum which seems more suitable!
    We are programming a little WebGL christmas card in our company to show our clients the new possibilities here. I would love to sync motions to the beat of an underlying music track. Syncronising it to Time.time of course does not work! So I tried to use audio.timeSamples, which is working perfectly while testing it, but seems to fail in the WebGL version.

    Can one of you WebGL-Gurus, or maybe Unity-guys and -gals tell me if timeSamples is functional at this point? I know that all this is still beta, but it would be awesome if we could get it running for Christmas! :)

    In the meantime i printed out timeSamples to browser screen via ui.text and it just does not count up on WebGL!?

    Regards,
    Tim
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Audio functionality in WebGL is rather limited, unfortunately. Don't expect anything but basic positional audio to work.

    The reason is that we use FMOD for audio on all platforms, but we cannot use that on WebGL due to threading and other requirements, so we used Web Audio instead. Some functionality may still be added, because it is simply not implemented right now, but it will never be up to par with other platforms. For audio.timeSamples, I'd have to investigate if we can implement that - could you file us a bug so we don't forget? No promises for 5.0 and Christmas, I'm afraid, though.
     
    DanSuperGP likes this.
  3. astronaut_tim

    astronaut_tim

    Joined:
    Apr 18, 2014
    Posts:
    7
    Hi Jonas,

    thank you for replying so quick! I will file a bug and keep fingers crossed! :) Great work so far with your WebGL implementation!

    Best,
    Tim
     
  4. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Nice to see that kind of quality answer.
     
  5. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,303
    @jonas echterhoff would it be possible to review the whole audio API and implement what is possible / discard what is not for the time being ?
    I see no point in submitting a bug report for each audio API call/property which does not work in WebGL.
    I have rather peculiar audio project and with Webplayer slowly dimishing in the future I would still like to export and play it in the browser, if possible.