Musepack Forums  

Go Back   Musepack Forums > Main > Tech

Reply
 
Thread Tools Search this Thread Display Modes
Old 08 March 2009, 05:38 am   #1
getID3
Member
 
Join Date: Mar 2009
Posts: 2
Default 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).
getID3 is offline   Reply With Quote
Old 08 March 2009, 10:15 am   #2
r2d
Musepack developer
 
Join Date: Sep 2006
Location: Villeurbanne - France
Posts: 36
Default

Quote:
Originally Posted by getID3 View Post
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
r2d is offline   Reply With Quote
Old 08 March 2009, 11:08 am   #3
getID3
Member
 
Join Date: Mar 2009
Posts: 2
Default

Quote:
Originally Posted by r2d View Post
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.
getID3 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:12 am.


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