NEW 228971
decodeAudioData should support .mov files recorded by iPhone
https://bugs.webkit.org/show_bug.cgi?id=228971
Summary decodeAudioData should support .mov files recorded by iPhone
Rob
Reported 2021-08-10 14:36:46 PDT
In Safari for iOS, the decodeAudioData method of the WebAudio api is unable to extract an audio buffer from .mov videos recorded with iPhone, despite the fact that the <video ...> element can play these videos and their audio correctly. Running the following example from Safari in an iPhone X, the 'it failed... err:' alert is always shown when attempting to load a .mov file recorded with the phone: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>decodeAudioData test</title>] </head> <body> <input type="file" accept="video/*" id="video-test-input"> <script> const fileSelector = document.getElementById('video-test-input') fileSelector.addEventListener('change', e => { const [file] = e.target.files const reader = new FileReader() reader.addEventListener('load', () => { new AudioContext({sampleRate: 44100}) .decodeAudioData(reader.result, function(buffer) { alert('it worked! duration: ' + buffer.duration) }, function (err) { alert('it failed... err: ' + err) }) }) reader.addEventListener('error', () => alert('file read failed... err: ' + reader.error)) reader.readAsArrayBuffer(file) }) </script> </body> </html> mp4 videos work fine with this example, but it limits the utility of this feature a lot when the videos natively recorded by the device can't be used.
Attachments
Radar WebKit Bug Importer
Comment 1 2021-08-17 14:37:26 PDT
Note You need to log in before you can comment on or make changes to this bug.