Musepack Forums

Musepack Forums (https://forum.musepack.net/index.php)
-   Tech (https://forum.musepack.net/forumdisplay.php?f=7)
-   -   SV8 StreamHeader documentation: number of channels (https://forum.musepack.net/showthread.php?t=582)

getID3 08 March 2009 05:38 am

SV8 StreamHeader documentation: number of channels
 
Now that SV8 is finally "final", I've extended getID3() to support it. A few hours coding later it all seems to be working OK, except for the "channel count" value in the Stream Header Packet. The documentation seems slightly off here -- it shows a value range of 1..16, but fails to clarify that the stored value is 0..15 and the actual number of channels is this +1 (so mono audio is stored as "0", stereo is stored as "1", etc).

r2d 08 March 2009 10:15 am

Quote:

Originally Posted by getID3 (Post 2260)
The documentation seems slightly off here -- it shows a value range of 1..16, but fails to clarify that the stored value is 0..15 and the actual number of channels is this +1 (so mono audio is stored as "0", stereo is stored as "1", etc).

The value is stored in 4 bits (size column), so can only take values 0 to 15. Those values must be interpreted as 1 to 16, so just add 1.
In case of doubt, you can use the sources :
http://trac.musepack.net/trac/browse...eaminfo.c#L206

getID3 08 March 2009 11:08 am

Quote:

Originally Posted by r2d (Post 2261)
Those values must be interpreted as 1 to 16, so just add 1

Yes, I realized that (after a little while), but it's that phrase that's missing from the documentation that would make it all clear from the outset. If I see a field labeled "number of channels", it's not immediately obvious that I should add 1 to it to get the number I'm looking for, if the documentation doesn't say so.


All times are GMT. The time now is 09:14 am.

Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2019, vBulletin Solutions Inc.