-
-
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
AudioTag backend. #192
AudioTag backend. #192
Conversation
Thank you, @jlegoff! Indeed, there is demand for both pure audio tag (for fallback) and audio-tag-in-Web-Audio (for filters and such). However, I wouldn't like to support a pure audio tag solution. There's waveform.js that does pretty much that. JSON + audio tag (and no Web Audio). What I would like to support, is an optional parameter of So, one would call it like this:
|
Yes there is interest. :) The thing about waveform.js is that it doesn't handle audio playback and interactivity. It only lets you display the waveform unless you are streaming a soundcloud specific file. |
Ah, I didn't know. Well, then let's go for it. I think the audio tag backend might share some methods with the MediaElementSource backend to avoid code duplication. The peaks as the second parameter to |
So do you think that loadStream should always use the AudioTag backend, then either call drawAsItPlays or drawBuffer depending on whether the peaks are passed in? In this case shouldn't the backend initialized in the load method instead of init? |
What I mean is, we shouldn't make The thing is, the In case of the |
Otherwise, create a separate load function, like |
Ok, I updated the code. It got a little more complicated than I had planned. This is what I did:
ps. I hope you didn't get notified each time I pushed a commit! |
Great, thanks! A separate |
Yeah, I wasn't sure about the |
Well, those three methods in |
Right, I can remove that file and duplicate the functions, no problem. Any other comments? I'll be travelling in the next few days so I won't be able to work on it until the end of the week. |
This backend allows to reproduce an audio file without the webaudio api. The peaks then need to be provided as an argument in the parameters.
Seems like it won't merge automatically now. |
@jlegoff I had to reimplement the audio tag backend in terms of the Web Audio media backend. Please check the master branch. Thanks for driving this idea and enlightening discussions in this PR. |
Hi,
First, thanks for your project! It works really well and the code is clear and easy to modify.
So I've been tinkering with it in order to be able to load large audio files (>1 hour), which didn't work for me. I'm aware of the streaming mode, but I want the wave to be drawn straight away. The only solution I've found is to get my server to compute them and send them to wavesurfer.
So I did two things:
This is a work in progress and not very well tested. I wanted to let you know about it in case you think this might interest other people.
A couple of comments:
At some point I started moving the downloadArrayBuffer and loadArrayBuffer into the WebAudio backend. My goal was to be able to do something like:
but then I realized I'd broken the loadBlob function. I could have fixed it but I prefered dropping you a word in order to know what your take is on this. Right now my feeling is that websurfer.js is too aware of the stream handling and that this could be delegated to the backend (or something else).
I also don't like passing in a function in the parameters, but this was the easiest way of getting it to work for me.
So there you go, sorry for the long comment :-)