Kinda tagential to the thread, but what's the best book for an introduction to audio programming for an experienced, language agnostic coder (java, c, c++, obj-c, etc)?
I don’t know who the Web Audio API is designed for
141–150 of 179 posts
Re: I don’t know who the Web Audio API is designed for
#142I have to cast a vote in opposition here. I've been heavily into procedural audio for a year or two, and have had no big issues with using Web Audio. There are solid libraries that abstract it away (Tone.js and Tuna, e.g.), and since I outgrew them working directly with audio nodes and params has been fine too. The big caveat is, when I first started I set myself the rule that I would not use script processor nodes.…
Re: I don’t know who the Web Audio API is designed for
#143The Web Audio API is designed for web developers who would want to integrate sound into their web apps. Notifications, etc. That pre-browser era where we would have sounds for everything. Minimize window, user logged in, logged out, all that crap. Also the API has good support for visual. Spectrum analysis. This is pretty good for an education course to offer for beginners on sound processing. I wouldn't use it for a…
This explanation doesn't fit, because already solved all the scenarios you're describing. Web Audio attempts to solve other problems, and does a bad job of it.
Re: I don’t know who the Web Audio API is designed for
#144Earlier quoted context omitted.
But Chrome for Android didn't come out until 2012 and Chris Rogers started the Web Audio work in 2009. I think someone would have had to have been exceptionally farsighted to think "Android's audio stack is going to suck for several years so we need to design around that now".
At that point in time, though, you could be forgiven with "Sheesh. Javascript is so painfully slow that nobody will ever pass PCM samples around in it." So, at every point in time up to and including now, you've always got something resisting low-latency PCM. Android is just the latest reason. Side note: it looks like Chris Rogers bowed out of Web Audio about 2012/2013 timeframe.
Also, it was obvious JS perf would get better and better.
Re: I don’t know who the Web Audio API is designed for
#145EDIT: I should also add that the teams behind the apis are quite responsive. You can make an impact in the direction of development simply by making your needs/desires known.
Re: I don’t know who the Web Audio API is designed for
#146I disagree with a lot of the assertions in this blog. You have to suspend some of your expectations since this is all .js. you can't have a js loop feeding single samples to a buffer. Js isn't deterministic to that level of granularity, but overall it's fast enough to generate procedural audio in chunks if you manage the timing. If you check out some of the three.js 3d audio demos you can see some pretty cool stuff b…
Why not? I linked a test app [0] in my post that generates generate PCM data on demand, and fast. It works deterministically on all the browsers. Mozilla certainly implemented AudioData back in 2011 and it was fast enough for them.
> He'll I wrote a tron game and did the audio using audio node chains and managed to get something really close to the real tron cycle sounds, without resorting to sample level tweaking
Why couldn't this be a high-level userspace library like three.js? Yes, with a lot of creative energy, you can recreate a lot of sounds, I'm willing to believe that. But I think a low-level API would have been more useful from the getgo.
Re: I don’t know who the Web Audio API is designed for
#147Here's my take on the history here: http://robert.ocallahan.org/2017/09/some-opinions-on-history... From the beginning it was obvious that JS sample processing was important, and I tried hard in the WG to make the Web Audio API to focus on that, but I failed.
Re: I don’t know who the Web Audio API is designed for
#148Web audio can be used with this: https://wavesurfer-js.org/
I'm not making the connection between the link and the point you're trying to make. Can you elaborate?
Re: I don’t know who the Web Audio API is designed for
#149This is not a wart, this is a security feature. Of course, it wouldn't be a necessary limitation if the web wasn't so complicated, but the web is complicated.
Re: I don’t know who the Web Audio API is designed for
#150Earlier quoted context omitted.
You're making music. It's not that difficult. http://kruhft.bandcamp.com/ Here's a synth using the technique: http://busfactor1.ca/kruhft
I propose a challenge then. I'll give you an arbitrary stream in the format of a .wav, and you send me code, in JavaScript, that uses an series of infinite OscillatorNodes that reproduces that stream completely accurately. I won't even make you write the code that generates the stream, I'll just require that one sample. If you can do it, I'll give you $1000 out of my own pocket.
Given Nyquist, a non-infinite series of [non-trivial power of 2] nodes will do the job just fine.
Audio FFT/iFFT processing typically uses 512 or 1024 bins, although sometimes you can get away with fewer.
In practice, iFFT doesn't use discrete oscillators for resynthesis, because the whole point of iFFTs is to limit the amount of work you have to do.
But there's no reason in theory a limited number of oscillators couldn't do the job. (I've done resynthesis like this in SuperCollider when I wanted special effects that FFTs can't produce.)
I doubt WA would be fast enough on most machines, but it would probably be possible - if rather dumb - on powerful hardware.