Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 6-channel FLAC believes it is a 2-channel FLAC? (Read 2900 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

6-channel FLAC believes it is a 2-channel FLAC?

Hi all.  I've got a problem with a multichannel FLAC.  I compressed a WAV that came from an audio DVD, and even though the original data was from a 6-channel (5.1) source, the STREAMINFO now reports it as only having 2 channels!  The weird thing especially is that one of the comments reads "waveformatextensible_channel_mask=0x003F".  I can't even decode the file, since trying to makes the command-line tool say
Code: [Select]
filename.flac: ERROR, channels is 6 in frame but 2 in STREAMINFO
filename.flac: ERROR while decoding data
                      state = FLAC__STREAM_DECODER_READ_FRAME

and die. 
The source file definitely used the correct WAVEFORMATEXTENSIBLE extensions - there were absolutely no errors during encoding.  Its quality was 24-bit depth at 96000 Hz.
I tried to transcode the file by passing "flac --channels=6 filename.flac -o newfilename.flac", but the resulting file came back in 2 channels only (and a much smaller file)!
Also, according to this thread, metaflac can't modify STREAMDATA info, so I apparently can't just set the channels to '6'... does anyone have any idea of how this file can be fixed?

Oh, yeah, I'm also using FLAC 1.2.1 on Linux.

6-channel FLAC believes it is a 2-channel FLAC?

Reply #1
Try opening the file in a hex editor and going to byte 0x14.  Its value is probably 0x03.  Try changing it to 0x0B and saving the file.  With any luck, that'll put the streaminfo and frame headers back in sync.

6-channel FLAC believes it is a 2-channel FLAC?

Reply #2
Awesome!  That did it!  Thanks a lot, tuffy.  I wonder why metaflac doesn't have any provision for this situation.