4 ms·
I find the lack of a common API for audio across OSes a tragedy. The waves are so deadly simple to work with that you could even use them as exercises to start
by slx26 6y ago
I find the lack of a common API for audio across OSes a tragedy. The waves are so deadly simple to work with that you could even use them as exercises to start learning programming. You would also need to be aware of the buffer you send the audio samples to; yes, you need to be aware that latency exists, there's no way around that. But in practice it's much more annoying: you have to deal with the APIs on each OS, which treat audio devices differently. Even getting info about the devices might be poorly documented and rather cumbersome, and then each device might or might not support the sample format you need/want, and might or might not support the buffer sizes you need/want. And if you try to work with a language that's not C/C++, then you have to resort to C wrappers to connect to the APIs (which in many languages is not trivial). 99% of the things we want to do could be so easy (give me a format that's 100% supported everywhere, a minimum buffer size supported everywhere, and support for 2 channels everywhere)... but nope.
- PaulDavisThe1st 6y agoWhat's the common API for drawing across OSes? What's the common API for video across OSes? What's the common API for "put this string in a message dialog on the screen" across OSes? And meanwhile there's JACK, RtAudio, PortAudio and several other crossplatform APIs, most of which have wrappers in non-C languages (despite the problems with realtime audio that this can lead to).
- ratww 6y agoLack of a common API is a problem even inside OSs. Here's Windows: http://shanekirk.com/2015/10/a-brief-history-of-windows-audio-apis/ http://shanekirk.com/2015/10/a-brief-history-of-windows-audi... And I disagree that it's deadly simple... Even sound synthesis (where it's "just math") is very hard, because you have to watch out for aliasing. Same if you're changing pitch or doing anything other than playing back a WAV. Also, it's hard-realtime, which limits the programming languages you can use. Then, if you're not using the OS audio mixer (lots of different reasons not to), you gotta do the mixing yourself, which is another can of worms.
- slx26 6y agoI have worked a bit with ALSA and dabbled in VST development and I understand some of these issues. I agree with you, but these are the inherently hard problems that we can't remove; I still believe accessibility can be much improved. By the way, the article you linked is really good, thanks for that. Anyone else reading this discussion will surely be interested in that article too.