RiffMask: Display and Change WAV File dwChannelMask




RiffMask.exe is a C# console application for Windows that displays and optionally can change the 4-byte dwChannelMask value in a multichannel PCM WAV file.
RiffMask parses the WAV file header for validity, displays all information in the format chunk including the dwChannelMask value for WAV files with the WAVE_FORMAT_EXTENSIBLE format tag. The output (speaker) channels specified in dwChannelMask (if present) are listed. Optionally the value of the dwChannelMask, specified as a hex value, can be changed.

Download RiffMask (9,728 bytes .NET 2+)

Sample Output:

C:\.......>riffmask
PCM WAV filename to open:
wav24_96000_1000_1000_1000_1000_1000_1000.wav

WAV header preview  [80 bytes]
52  49  46  46  3C  D6  83  00  57  41  56  45  66  6D  74  20
28  00  00  00  FE  FF  06  00  00  77  01  00  00  5E  1A  00
12  00  18  00  16  00  18  00  3F  00  00  00  01  00  00  00
00  00  10  00  80  00  00  AA  00  38  9B  71  64  61  74  61
00  D6  83  00  00  00  00  00  00  00  00  00  00  00  00  00
"data"  [64 61 74 61]

This appears to be a valid RIFF WAV header

wFormatTag:  WAVE_FORMAT_EXTENSIBLE
nChannels: 6
nBitsPerSample: 24
nSamplesPerSec: 96000
nBlockAlign: 18
wValidBitsPerSample: 24
dwChannelMask: 0x0000003F  (binary: 111111)
Channels specified by dwChannelMask:
        SPEAKER_FRONT_LEFT
        SPEAKER_FRONT_RIGHT
        SPEAKER_FRONT_CENTER
        SPEAKER_LOW_FREQUENCY
        SPEAKER_BACK_LEFT
        SPEAKER_BACK_RIGHT

Change the dwChannelMask Value? (y or n)
y
Enter a new channelMask value in hex (0 to 0xFFFFFFFF)
060F
New channelMask:  0x0000060F  (binary: 11000001111)
Channels specified by dwChannelMask:
        SPEAKER_FRONT_LEFT
        SPEAKER_FRONT_RIGHT
        SPEAKER_FRONT_CENTER
        SPEAKER_LOW_FREQUENCY
        SPEAKER_SIDE_LEFT
        SPEAKER_SIDE_RIGHT


References


Multiple Channel Audio Data and WAVE Files
WAVEFORMATEXTENSIBLE documentation