Hello, I had a little more time to devote to this and have something that compiles but has not yet been run - thus version -0.1. http://ax.to/mpg123 I’m intending to write some tests for this, so I sent a message to the mpg123 people asking if they had a library of exotic mp3 files that I could use.
Here’s my AudioFormat question.
An AudioFormat typically lets the source file determines the sample rate, bit depth, float vs integer etc. . And that’s what I’m doing here - I’m finding that information from the mp3 and passing it right through as well as I can.
But in practice, I suspect that’s not what I’ll actually want much of the time. In fact, what I’ll want will be “open this mp3 file and give me 16-bit integer samples, no matter what was in the file”.
So here’s my plan. There will be a “default” mpg123 AudioFormat which I’ll register as the official mp3 audio format which passes through the input format. But there will also be a factory that lets you create your own AudioFormat where you override the input format and request your own.
BTW, I’m realizing that mpg123 doesn’t seem to write mp3s, which is fine for my purposes but disappointing for people who want a complete solution.