New issue
Advanced search Search tips

Issue 627846 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

No sound for the offline dinosaur game on iOS

Project Member Reported by gambard@chromium.org, Jul 13 2016

Issue description

The sound is not available for the offline dinosaur game on iOS.

This may be caused by the audio context used by iOS for decoding the mp3 files. Every other platform is using AudioContext where we have to use webkitAudioContext on iOS.

The webkitAudioContext on iOS cannot decode the mp3 files: the this.audioContext.decodeAudioData(buffer) function fails.

One possible fix could be to change the mp3 files so they can be played on iOS.
 

Comment 1 by baxley@chromium.org, Jul 14 2016

Cc: kkhorimoto@chromium.org edwardjung@chromium.org
Status: Available (was: Untriaged)
Cc: -edwardjung@chromium.org
Status: edwardjungchromium.org (was: Available)
This is a known problem but I couldn't find an acceptable workaround. 

Do you know why webkitAudioContext can't decode the audio files when they are base 64 encoded? I haven't done any more tests on this recently, so don't know if anything has changed since moving to WKWebView and if this works now.
Owner: edwardjung@chromium.org
Status: Assigned (was: edwardjungchromium.org)
It is not about decoding base 64 files. This example http://html5doctor.com/taking-web-audio-offline-in-ios-6-safari/ works and it is base 64 encoding.
I think it might be caused by something like this: http://stackoverflow.com/questions/10365335/decodeaudiodata-returning-a-null-error (the problem could be due to the mp3 file itself) but the fix proposed in this post does not work.
Thanks, yes the decoding seems to fail, I'll have a look at this again, trying alternate MP3 files. 


This is happening because the loadSounds function is wrapped in a "if (!IS_IOS)" condition.  Removing this throws an exception, however, as AudioContext() cannot be found.  It looks like iOS requires using the "webkit" prefix for this class, so I did a quick attempt at enabling that code on iOS and initializing the audio context using "new webkitAudioContext".  With this change, no exceptions are thrown (i.e. iOS found webkitAudioContext), but the sounds are still not playing...
Yes, I mentioned that in #0.
The error comes from this.audioContext.decodeAudioData(buffer) (using webkitAudioContext). The error returned by this function (by adding a 3 argument) is null.
re #5: This was done because there wasn't a suitable work around at the time. Am looking at generating the sound files a different way.
Components: Mobile>iOSWebView
Components: -Mobile>iOSWebView Mobile>WebView>Glue
Components: Mobile>iOSWeb
Components: -Mobile>WebView>Glue
Components: -Mobile>iOSWeb Mobile>iOSWeb>Media

Sign in to add a comment