RESOLVED MOVED 157362
AudioContext.decodeAudioData() issues with decoded duration and sample length
https://bugs.webkit.org/show_bug.cgi?id=157362
Summary AudioContext.decodeAudioData() issues with decoded duration and sample length
naomiaro
Reported 2016-05-04 15:32:10 PDT
Created attachment 278133 [details] an mp3 where I experience the issue AudioContext.decodeAudioData() returns double correct duration and samples array half filled with silence My file is 30 seconds long - I'm told it's 60 seconds long on iOS and receive a samples array with the last half all garbage silence values. http://naomiaro.github.io/waveform-playlist/stem-tracks.html I've noticed this in my project above. It works correctly in Firefox and Chrome.
Attachments
an mp3 where I experience the issue (469.38 KB, audio/mpeg)
2016-05-04 15:32 PDT, naomiaro
no flags
File doesn't decode properly (deleted)
2016-05-05 04:07 PDT, naomiaro
no flags
naomiaro
Comment 1 2016-05-05 04:07:22 PDT
Created attachment 278161 [details] File doesn't decode properly Audio is missing sample data. Only the first 8 minutes and 35 seconds of the audio seem to decode. File should be around 1 hour in length.
Oscar Dub
Comment 2 2016-11-07 03:24:33 PST
> AudioContext.decodeAudioData() returns double correct duration and samples array half filled with silence I've had reports of this same problem in an audio player I'm working on, and can replicate it in Safari on iOS 10.1. Here's the User Agent on the iOS Simulator where I'm finding this: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1 Looking currently for a workaround. Best, Oscar
Oscar Dub
Comment 3 2016-11-07 04:25:47 PST
2 more pieces of information: 1) I also find this bug in Safari 9.1.3 on MacOS 10.11.6. 2) Using a mono .mp3 file, the duration and length properties on the AudioBuffer report correctly. This backs up my initial assumption that the bug is caused by Webkit reporting the number of samples rather than the number of frames in the length property.
Jer Noble
Comment 4 2016-11-07 09:35:26 PST
These files show the same properties when opened directly with AVFoundation on macOS. This is likely a platform bug and needs a Radar to be routed to the correct team at Apple.
Radar WebKit Bug Importer
Comment 5 2016-11-07 09:42:16 PST
Jer Noble
Comment 6 2016-11-07 10:26:58 PST
(In reply to comment #1) > Created attachment 278161 [details] > File doesn't decode properly > > Audio is missing sample data. Only the first 8 minutes and 35 seconds of the > audio seem to decode. File should be around 1 hour in length. You can't really decode an hour long .mp3 with the Web Audio API (or at least, you shouldn't). That's upwards of 8GiB of uncompressed audio (assuming 24-bit, stereo, 44.1kHz).
Brent Fulgham
Comment 7 2022-02-10 14:38:43 PST
The fix for this issue was needed outside the WebKit project, therefore this is being resolved as 'Moved'. This should now be fixed in shipping software.
Note You need to log in before you can comment on or make changes to this bug.