-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large MP3 files cause DOM Exception 12 #9
Comments
Hi @goedev001, I'm away from computer this week, but just a guess — try to lower the Thanks for your report! |
Also this might help (see a workaround in the bottom): https://bugs.webkit.org/show_bug.cgi?id=106658 |
Hi @katspaugh, thanks for your reply! I tried lowering the sampleRate (which is called fftSize in webaudio.js, if I'm correct), but no luck. Thanks! |
Vernon, that TODO was about streaming audio (to draw the waveform as it plays). As for upgrading, I'd include your changes if you made a pull request. Otherwise, just wait until I get back to computer next week and we shall look for a reliable solution. |
Hi, Very interesting plugin. I tried downloading it and tried to run the example but it seems not to play. Can you plz help me out in this. |
Khm-khm. @ajeethboaz, you should start your own issue with more details, and I would help you gladly. Thanks! |
Sorry, But am not able to play an mp3, If I can do that I can proceed.... |
Hi @katspaugh, do you have any updates for us / any estimated time when this issue will be resolved? Thanks! |
Hey @goedev001! I'll get at it tomorrow, will keep you posted. |
@goedev001, could you provide the exact file that causes the problem? I tried with a 68 MB MP3 from Librivox and it loads OK in Safari (though it crashes Chrome tabs completely). |
That's exactly my problem. Files that are > 8 MB cause Google Chrome tabs to crash. |
Whoops, pressed the wrong button... Sorry. |
@goedev001, I've added the workaround from the WebKit bug report and it seems to work with big files now. However, they still take an unpractical eternity to decode. See 8ddef58 @ajeethboaz, you need to serve the example from an HTTP 1.1 server in order for it to work, you can't just open the downloaded file in the browser. If you have any further questions, please create a separate issue. This one is only about large MP3 files. |
@katspaugh, I'm sorry but I've pulled the latest version of the script and it still causes a crash! Would you like to receive the URL of the project where we're using your plugin? Maybe that can help you to solve te problem. Also, this seems a common error with Google Chrome. I think the web audio API isn't completely bug free... |
Yeah, definitely do. I'm interested in what you are using it for, anyway. |
Our poject can be seen on: http://vernonweb.nl/audio/ |
Hey @katspaugh! Do you have any idea what the problem might be? :-) |
Hi @goedev001! Sorry that it takes so long to resolve this. From what I managed to google, Safari and Chrome can't decode a large binary due to memory limits. The 8ddef58 patch seems to strip off the size meta-data, that's why it sometimes (I guess, when file's actual size is only slightly above the safe limits) works. People are suggesting streaming audio through HTML5 Audio, so that WebAudio could decode only a small piece at a time. I think @kevincennis has done this work already in https://github.com/kevincennis/Sound.js, so we might use this library. |
what was the solution here? |
@kdelmonte, no solution, in fact. |
Understood. Great tool! I'll find a work around. |
@kdelmonte, thank you. What are you using it for? |
@katspaugh using it as a recording player. |
@katspaugh I'm thinking ill try splitting the file in chunks on the server and will create an instance of wave surfer for each part which I will then put right next to each other and will use your events to make them function like one... What are your thoughts? |
@kdelmonte, you can load the files, extracting the peaks, then draw the concatenated peaks array as a single waveform. Something along the lines of:
Also, beware that chunks must be themselves whole audio-files complete with metadata, otherwise it won't be able to decode them (see the WebKit bug report linked above). |
Thank you... I will try it.. One question though, in the line "var pixels = wavesurfer.drawer.getPixels(duration);" what is "duration" supposed to be? |
@kdelmonte oops! |
@katspaugh So, it's look large files are a no go then? Bummer! Great library though. I'm looking to play more with web audio and this looks like a great library to start working with. |
@aboutaaron, alas, the technology ( Thanks for your interest! 😄 |
I guess the problem is still not solved? We wanted to use this library for our HTML5 audio app about 7 months ago, but we felt the HTML5 Audio API is too limited to continue the project. This was one of the main issues we walked into. |
It's not; sorry to disturb the slumber of this thread! |
Too bad. The problem is a Google Chrome issue, right? :-( |
The problem is with our approach maybe. In order to draw the waveform, you need to process (decode) the whole audio at once which takes hundreds of megabytes of memory. I shall try once more to mix together |
Cool! I'll update the project soon, so we can test it! :-) |
For what it's worth there's at least one other person, me, who is very On Mon, Nov 25, 2013 at 2:37 PM, Vernon notifications@github.com wrote:
Pat |
Sorry guys, it still crashes with |
This is probably way overkill for wavesurfer itself, but for people running into this problem... MP3 files are broken up into frames, which can each be decoded independently. It should be possible (although maybe not easy) to split an Arraybuffer into a bunch of separate chunks that are each The MP3 format is kind of tricky, but finding frames shouldn't be too hard if you read up a bit on the spec. It certainly helps to have some experience working with binary data, though. If I get some time, I'll try to put together a proof of concept and post a link. |
Instead of starting a new thread on streaming audio, AFAIK, this thread is the most appropriate to propose the idea of using m3u playlists that essentially works like streaming audio, or consecutively playing smaller mp3 files. I am pre-generating the waveform (JSON) ahead of time, so it would be great to have a way to play |
Does anyone found a solution for this? I am also facing the same issue. |
Hi there,
I absolutely love this plugin. It works great when I try to play small MP3 files.
However, when I try to load a larger MP3 file (51 MB), I get an JS error: DOM Exception 12.
The MP3 file seems to load fine in the beginning, but in the end it's slowing down (the line which indicates that it's loading moves at a much slower rate). My Chrome browser tab also crashes at the end (gives me a purple error message).
This is the error I'm getting:
When I'm looking at webaudio.js it seems to be an issue with the decodeAudioData() method.
Is this a known issue? And how can I fix this problem?
Help would be appreciated, since I'm stuck with my project right now.
Thanks in advance!
The text was updated successfully, but these errors were encountered: