Windows Media Audio Pro: Difference between revisions
Jump to navigation
Jump to search
(example) |
(Add channel configurations.) |
||
Line 9: | Line 9: | ||
byte 1-2 Size of extradata | byte 1-2 Size of extradata | ||
byte 3-6 Channel mask (http://msdn2.microsoft.com/en-us/library/ms790436.aspx) | byte 3-6 Channel mask (dwChannelMask) (http://msdn2.microsoft.com/en-us/library/ms790436.aspx) | ||
byte 7-14 Unknown | byte 7-14 Unknown | ||
byte 15-16 Mask used for calculating samples per frame (int16_t) | byte 15-16 Mask used for calculating samples per frame (int16_t) | ||
Line 17: | Line 17: | ||
[18] [0] [3f] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [e0] [0] [0] [0] | [18] [0] [3f] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [e0] [0] [0] [0] | ||
Example extradata dump of a stereo file: | |||
[18] [0] [3] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [e0] [0] [0] [0] | |||
== Channel configuration == | |||
Wma pro uses the dwChannelMask for channel configuration. | |||
SPEAKER_FRONT_LEFT 0x00001 | |||
SPEAKER_FRONT_RIGHT 0x00002 | |||
SPEAKER_FRONT_CENTER 0x00004 | |||
SPEAKER_LOW_FREQUENCY 0x00008 | |||
SPEAKER_BACK_LEFT 0x00010 | |||
SPEAKER_BACK_RIGHT 0x00020 | |||
SPEAKER_FRONT_LEFT_OF_CENTER 0x00040 | |||
SPEAKER_FRONT_RIGHT_OF_CENTER 0x00080 | |||
SPEAKER_BACK_CENTER 0x00100 | |||
SPEAKER_SIDE_LEFT 0x00200 | |||
SPEAKER_SIDE_RIGHT 0x00400 | |||
SPEAKER_TOP_CENTER 0x00800 | |||
SPEAKER_TOP_FRONT_LEFT 0x01000 | |||
SPEAKER_TOP_FRONT_CENTER 0x02000 | |||
SPEAKER_TOP_FRONT_RIGHT 0x04000 | |||
SPEAKER_TOP_BACK_LEFT 0x08000 | |||
SPEAKER_TOP_BACK_CENTER 0x10000 | |||
SPEAKER_TOP_BACK_RIGHT 0x20000 | |||
And the following configurations are valid: | |||
channelmasks[8] = { | |||
NULL, | |||
SPEAKER_FRONT_LEFT, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT, | |||
SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT|SPEAKER_FRONT_LEFT_OF_CENTER, | |||
} | |||
To get the active channel configuration use the channels parameter from the container and do a look up in this table. | |||
channelmask = channelmasks[container channels] | |||
Note that this makes the extradata channel mask redundant. | |||
[[Category:Audio Codecs]] | [[Category:Audio Codecs]] | ||
[[Category:Undiscovered Audio Codecs]] | [[Category:Undiscovered Audio Codecs]] |
Revision as of 05:09, 29 December 2007
- Microsoft Audio ID: 0x0162
- Company: Microsoft
- Samples: http://samples.mplayerhq.hu/A-codecs/WMA9/
The next generation of Windows Media audio codecs.
Extra data layout
This is a rough guess of the extra data from the asf container (little endian order).
byte 1-2 Size of extradata byte 3-6 Channel mask (dwChannelMask) (http://msdn2.microsoft.com/en-us/library/ms790436.aspx) byte 7-14 Unknown byte 15-16 Mask used for calculating samples per frame (int16_t) byte 17-18 Unknown
Example extradata dump of a 5.1 file:
[18] [0] [3f] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [e0] [0] [0] [0]
Example extradata dump of a stereo file:
[18] [0] [3] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [e0] [0] [0] [0]
Channel configuration
Wma pro uses the dwChannelMask for channel configuration.
SPEAKER_FRONT_LEFT 0x00001 SPEAKER_FRONT_RIGHT 0x00002 SPEAKER_FRONT_CENTER 0x00004 SPEAKER_LOW_FREQUENCY 0x00008 SPEAKER_BACK_LEFT 0x00010 SPEAKER_BACK_RIGHT 0x00020 SPEAKER_FRONT_LEFT_OF_CENTER 0x00040 SPEAKER_FRONT_RIGHT_OF_CENTER 0x00080 SPEAKER_BACK_CENTER 0x00100 SPEAKER_SIDE_LEFT 0x00200 SPEAKER_SIDE_RIGHT 0x00400 SPEAKER_TOP_CENTER 0x00800 SPEAKER_TOP_FRONT_LEFT 0x01000 SPEAKER_TOP_FRONT_CENTER 0x02000 SPEAKER_TOP_FRONT_RIGHT 0x04000 SPEAKER_TOP_BACK_LEFT 0x08000 SPEAKER_TOP_BACK_CENTER 0x10000 SPEAKER_TOP_BACK_RIGHT 0x20000
And the following configurations are valid:
channelmasks[8] = { NULL, SPEAKER_FRONT_LEFT, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT|SPEAKER_FRONT_LEFT_OF_CENTER, }
To get the active channel configuration use the channels parameter from the container and do a look up in this table.
channelmask = channelmasks[container channels]
Note that this makes the extradata channel mask redundant.