Live data from Hacker News

I don’t know who the Web Audio API is designed for

blog.mecheye.net

21–30 of 179 posts

Re: I don’t know who the Web Audio API is designed for

#21
post #17
post #16

Earlier quoted context omitted.

Don't let the name fool you. OpenAL is a closed-source library, much like Wwise or FMOD or PortAudio, that just implements playback. Bizarrely enough, it is also the only one of these APIs that uses a similar "play this buffer" approach and suffers from the same issues as Web Audio's memory management, just without a GC. The actual audio equivalent to OpenGL is OpenSL [0], which I don't think picked up any support fr…

> OpenAL is a closed-source library So are all official OpenGL implementations (MESA isn't official, last I heard). Doesn't stop them from being a standard and being used, although I agree they would be better if they were open source.

OpenGL has to talk to hardware and is implemented by the hardware vendor. OpenAL does not have multiple implementations, isn't provided by hardware vendors and just wraps the platform audio API.

Re: I don’t know who the Web Audio API is designed for

#22
post #20
post #4

How to play a sine wave: const audioContext = new AudioContext(); const osc = audioContext.createOscillator(); osc.frequency.value = 440; osc.connect(audioContext.destination); osc.start(); "BufferSourceNode" is intended to play back samples like a sampler would. The method the author proposes of creating buffers one after the other is a bizarre solution.

I picked a 440Hz sine wave because I didn't want to write a more complex demo example, knowing full well someone would nitpick this. Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators.

It's a higher level API and you're deliberately ignoring all of its higher level features and concentrating on the part that clearly is underdeveloped. Maybe you should use your imagination instead of putting a square peg in a round hole?

Re: I don’t know who the Web Audio API is designed for

#23
post #21
post #17

Earlier quoted context omitted.

> OpenAL is a closed-source library So are all official OpenGL implementations (MESA isn't official, last I heard). Doesn't stop them from being a standard and being used, although I agree they would be better if they were open source.

OpenGL has to talk to hardware and is implemented by the hardware vendor. OpenAL does not have multiple implementations, isn't provided by hardware vendors and just wraps the platform audio API.

I'm not sure of your point here. Not sure why multiple implementations is a benefit for users. Audio is generic and hardware is cheap enough that the operating systems just implement and include drivers. It's a cross platform library that meets audio needs, including 3D/spatial audio, much like (and designed like) OpenGL.

Re: I don’t know who the Web Audio API is designed for

#24
post #20
post #4

How to play a sine wave: const audioContext = new AudioContext(); const osc = audioContext.createOscillator(); osc.frequency.value = 440; osc.connect(audioContext.destination); osc.start(); "BufferSourceNode" is intended to play back samples like a sampler would. The method the author proposes of creating buffers one after the other is a bizarre solution.

I picked a 440Hz sine wave because I didn't want to write a more complex demo example, knowing full well someone would nitpick this. Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators.

> Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators.

Somebody already did. Check out Fourier Theory. The oscillators (well actually just sin, the rest will give you some help as well) can be used to make any stream, technically.

Re: I don’t know who the Web Audio API is designed for

#25

My first lesson in this was the Roland MPU-401 MIDI interface. It had a "smart mode" which accepted timestamped buffers. It was great... if you wanted a sequencer with exactly the features it supported, like say only 8 tracks. It was well-intentioned, because PCs of that era were slow. The MPU-401 also had a "dumb" a.k.a. "UART" mode. You had to do everything yourself... and therefore could do anything. It turned out…

Hopefully poster is ok with this, but this guy would know as he was one of the first DAWs for Windows. Cakewalk/Sonar.

Re: I don’t know who the Web Audio API is designed for

#26
post #22
post #20

Earlier quoted context omitted.

I picked a 440Hz sine wave because I didn't want to write a more complex demo example, knowing full well someone would nitpick this. Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators.

It's a higher level API and you're deliberately ignoring all of its higher level features and concentrating on the part that clearly is underdeveloped. Maybe you should use your imagination instead of putting a square peg in a round hole?

> It's a higher level API

As the title of the post asks: "I don't know who the Web Audio API is designed for".

The high-level nodes are not featureful enough for professional audio production, and too slow and underspecified for game engines like FMOD / Wwise.

The low-level bits fall somewhere between impractical, deprecated, and useless.

Who is it designed for?

Re: I don’t know who the Web Audio API is designed for

#27
post #24
post #20

Earlier quoted context omitted.

I picked a 440Hz sine wave because I didn't want to write a more complex demo example, knowing full well someone would nitpick this. Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators.

> Please use your imagination and try to imagine one of infinitely many other streams that I could make at runtime that are not easily made with the built-in toy oscillators. Somebody already did. Check out Fourier Theory. The oscillators (well actually just sin, the rest will give you some help as well) can be used to make any stream, technically.

Unfortunately, you need an infinite number of them to construct any signal, and I think my computer would run out of memory before that :)

Re: I don’t know who the Web Audio API is designed for

#28
Stopped reading at: "Something like the DynamicsCompressorNode is practically a joke: basic features from a real compressor are basically missing, and the behavior that is there is underspecified such that I can’t even trust it to sound correct between browsers. "

Then if you look into it:

    dictionary DynamicsCompressorOptions : AudioNodeOptions {
             float attack = 0.003;
             float knee = 30;
             float ratio = 12;
             float release = 0.25;
             float threshold = -24;
Which are indeed the basics that you need and totally enough for most use cases.

Check out a vintage compressor that has a dozen implementation as VST plugins:

http://media.uaudio.com/assetlibrary/t/e/teletronix_la2a_car...

Re: I don’t know who the Web Audio API is designed for

#30

Stopped reading at: "Something like the DynamicsCompressorNode is practically a joke: basic features from a real compressor are basically missing, and the behavior that is there is underspecified such that I can’t even trust it to sound correct between browsers. " Then if you look into it: dictionary DynamicsCompressorOptions : AudioNodeOptions { float attack = 0.003; float knee = 30; float ratio = 12; float release…

Where's the sidechain input?
Post reply on HN