Closed olivierthereaux closed 11 years ago
To be honest I didn't know about them. I pieced this library together over the weekend and I fully consumed the API into my brain yet :). I'll be switching it out to use that though as it's exactly what I should have used in the first place. Is there anything else in that I've done wrong? Also, I wasn't sure how know when all the oscillators were done playing so I had to use a setTimeout()
to keep checking.
Ah, thanks. Good to know that it was not because the method is broken or not usable. I don't think I'm really qualify to critique the rest of it, but I'll keep looking.
That said, there is a W3C community group which we've created, where questions such as "am I using this right" are very much in scope. http://www.w3.org/community/audio-dev/
Great, thanks for that! I didn't realise that this would blow up so quickly. I just pushed this afternoon and it's already trending on Github. I'm a newbie when it comes to AudioContext
since I only learned about it over the weekend. I have some big plans with what I want to do though :+1:.
I'm trying to use linearRampToValueAtTime()
but it doesn't seem to work on the first time I try and fade it down, but then does work the subsequent tries. Also the fade up starts around the 50% mark and then goes up from there. I'd like if it worked closer to how my library currently does it as it seems much smoother. I also tried exponentialRampToValueAtTime()
but that didn't work at all. No errors, but also no volume change.
Not sure why it's not working. Have you looked at e.g. https://github.com/sourcefabric/Airtime/blob/6bdc2caaec274b6814c15c503d97dc5e3e00bba5/airtime_mvc/public/js/waveformplaylist/fades.js ?
Thanks for the link, I'll implement what they have there and see how I go. At the moment it's close to midnight and I have work tomorrow :). Have a good day/night!
@olivierthereaux - I've implemented this finally, only took 11 months :). When I tried it last time, there may have been some bugs in my code or Chrome itself. In any case, it was rather straight forward this time. Thanks again!
I was wondering how your fade (in/out) worked, and noticed that you are using:
Would it be less verbose/painful and probably more efficient to use one of the specified audioparam automation methods from http://www.w3.org/TR/webaudio/#methodsandparams-AudioParam ?
I think linearRampToValueAtTime() would do pretty much the same thing you are doing here.
Have you tried the methods and found them to not be usable, or did you not know about them? This could be interesting feedback to us in the W3C Audio WG.