by brody_hamer · 6y ago · 0 comments
`tail -f output.txt | aplay`
I know this is a lame takeaway, but I'm just so happy to learn about this.
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.
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.
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).
aplay was the missing link.