Questions about AudioFormat + version -0.1 of mpg123 format

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. :smiley: 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.