Bug 131581 - Lag/Latency when playing audio, breaks puzzlescript.net on safari
Summary: Lag/Latency when playing audio, breaks puzzlescript.net on safari
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-12 05:37 PDT by Stephen Lavelle
Modified: 2014-04-12 05:37 PDT (History)
0 users

See Also:


Attachments
Click the button, notice latency, clicking lots of times doesn't help. (1.56 KB, text/html)
2014-04-12 05:37 PDT, Stephen Lavelle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Lavelle 2014-04-12 05:37:36 PDT
Created attachment 229202 [details]
Click the button, notice latency, clicking lots of times doesn't help.

There's a bit lag when using audio tags.  Check out the demo and click the play sound button, and notice the delay before hearing the sound.  This doesn't occur in chrome or firefox.  I've had several users report this, though it's not universal.  It makes games made with the engine really unplayable for a lot of people in safari.

There are workarounds for audio latency in general using webkitAudioContext - but because the engine generates sound URLs, and because I can't find any way of populating an audiobuffer without using XMLHttpRequest (I've asked around quite a bit and can't find any alternatives), and because safari treats data URIs as being cross-origin requests, I'm stumped.

I thought that using cloneNode().Play() might have been a problem, but even just playing a single audio file once gives this problem (try remove cloneNode() from the example html file).