That doesn't make sense. Fractional rates at all could be considered for extremely low-frequency signals, but for anything audible … why?! Apart from that, I don't know of audio hardware accepting fractional rates. Of course, arbitrary resampling could use them. But even in my resampler in libsyn123 (which mpg123 uses at times), I took pains to keep the rates integer and have reproducible computations without rounding issues in the timebase (sample values themselves in float, though).
But anyhow, this general discussion is pointless for mpg123: The value in the frameinfo represents what the MPEG stream has stored, and there are no floating-point sampling rates in the MPEG audio standard.
Just use the long value in portaudio API, to be cast to double. It doesn't hurt and just works the same.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That doesn't make sense. Fractional rates at all could be considered for extremely low-frequency signals, but for anything audible … why?! Apart from that, I don't know of audio hardware accepting fractional rates. Of course, arbitrary resampling could use them. But even in my resampler in libsyn123 (which mpg123 uses at times), I took pains to keep the rates integer and have reproducible computations without rounding issues in the timebase (sample values themselves in float, though).
But anyhow, this general discussion is pointless for mpg123: The value in the frameinfo represents what the MPEG stream has stored, and there are no floating-point sampling rates in the MPEG audio standard.
Just use the long value in portaudio API, to be cast to double. It doesn't hurt and just works the same.