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: encoding 6-channel WAV to FLAC (Read 19642 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

encoding 6-channel WAV to FLAC

what do i need in the command line?

i'm using flac 1.2.1 and foobar .9.4.4

normal encode options don't work and i have no idea how to get flac to handle 6-channel files.

encoding 6-channel WAV to FLAC

Reply #1
need more info than "doesn't work"

encoding 6-channel WAV to FLAC

Reply #2
i dont have any more info. what i have are 6-channel WAV files that i'd like to convert to flac, but i don't know what to put in the command line. you develop flac, right? if you had 6-channel WAV files you wanted to convert to flac, how would you do it?

encoding 6-channel WAV to FLAC

Reply #3
assuming you're on windows and you have flac installed, open a shell and do "flac 6channel.wav" or whatever the wav file name is.

didn't foobar give you some kind of error message?

encoding 6-channel WAV to FLAC

Reply #4
yeah, foobar said it doesn't work, check the parameters. and the flac frontend says they're not wave_format_extensible, whatever the hell that means.

i have "-s -8 - -o %d" in my command line. it works fine with 2 channel files, but not with 6 channel files. i know flac can handle 6 channel files because i can convert my 6 channel WAVs with dbpoweramp. the only problem there is, dbpoweramp uses flac 1.1.4, and i'd rather use one program to do all my converting. since "-s -8 - -o %d" aren't the right parameters, then what parameters do i need?

encoding 6-channel WAV to FLAC

Reply #5
i have "-s -8 - -o %d" in my command line.

foobar2000 produces incompatible (sort of non-standard) multichannel files, see here:  [a href='index.php?showtopic=49191']WAVEFORMATEXTENSIBLE, output wav files[/a]

You have to add the "--channel-map=none" switch to your command line parameters:
"-s -8 --channel-map=none - -o %d"

encoding 6-channel WAV to FLAC

Reply #6
^when i try those parameters, foobar converts the file ok, but then when i try to playback the file, i get "Unsupported format or corrupted file".

encoding 6-channel WAV to FLAC

Reply #7
^when i try those parameters, foobar converts the file ok, but then when i try to playback the file, i get "Unsupported format or corrupted file".

Works for me, foobar2000 0.9.4.4, flac 1.2.1. Check the extension, it must be "flac".

Quote
Duration : 3:27.008 (9936384 samples)
Sample Rate : 48000 Hz
Channels : 6
Bits Per Sample : 16
Bitrate : 1641 kbps
Codec : FLAC
Encoding : lossless
Tool : reference libFLAC 1.2.1 20070917
[/size]

Edit. The parameters used: "--ignore-chunk-sizes -s --best --channel-map=none - -o %d"

encoding 6-channel WAV to FLAC

Reply #8
my WAVs are 24BPS. when i convert them to 16BPS, they play, but not when i preserve them at 24BPS.


is there a parameter for BPS? i don't see the --channel-map=none parameter on the flac site, where did you get that from?

encoding 6-channel WAV to FLAC

Reply #9
my WAVs are 24BPS. when i convert them to 16BPS, they play, but not when i preserve them at 24BPS.

You should define output bitdepth in foobar2000: Preferences->Playback->Output. If your soundcard or it's driver do not support 24 bit playback, set Output bitdepth to 16 bit value. FLAC itself does support 24 bit multichannel audio.

is there a parameter for BPS? i don't see the --channel-map=none parameter on the flac site, where did you get that from?

There is no option for bitdepth in flac.exe, because flac preserves original bitdepth (it's a lossless codec - no loss). However, you can use foobar2000' on-the-fly bitdepth conversion feature.

The --channel-map option is undocumented, but there is additional information on these forums (and official mailing list too).

encoding 6-channel WAV to FLAC

Reply #10
the 24BPS WAVs play fine on my PC, and i can convert them to wavpack and they play fine (and i it converts with the same parameters i use for stereo/16BPS CD rips). i don't know what dbpoweramp does differently, but it can convert my 6 channel / 24BPS wavs to flac and play fine, but like i said earlier, it uses flac 1.1.4. either i'm missing something in my foobar parameters, or flac 1.2.1 just can't handle 6 channel / 24BPS files.



encoding 6-channel WAV to FLAC

Reply #13
if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none.  if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order.  sounds like your wav file needed --channel-map=none and it encoded ok with it.

I don't use foobar much so I don't know why it won't play.

encoding 6-channel WAV to FLAC

Reply #14
then what do i need in the command line?

Use the following preset with fb2k:
Code: [Select]
Preset: Custom
Encoder: flac.exe
Extension: flac
Parameters: --ignore-chunk-sizes -s --best --channel-map=none - -o %d
Format is: lossless
Highest BPS mode supported: 24 bit
Encoder name: FLAC


I have just verified that both foobar2000 0.9.4.4 and Winamp 5.35 play 6ch/24bit/48kHz FLAC fine. Flac.exe was from sf.net's "flac-1.2.1-win.zip" package.
Also, if you aren't using standard foobar2000 configuration (a 3rd-pty output plugin, DSP or something), try reverting to the standard configuration (DirectSound output, no DSPs etc.).

encoding 6-channel WAV to FLAC

Reply #15
well this is a big WTF.  i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4. still didn't work. just for the hell of it, i downloaded flac 1.2.0. guess what - it works! looks like i'll be sticking with 1.2.0 for my DVD-A rips.

encoding 6-channel WAV to FLAC

Reply #16
well this is a big WTF.  i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4.

Aha, confirmed

Flac.exe from the flac-1.2.1b.exe package produces broken 24bit flacs. Foobar2000 0.9.4.4 won't play it, Winamp 5.35 will play with skips.

Edit. Channel count and samplerate don't matter, all 24 bit audio is affected.

encoding 6-channel WAV to FLAC

Reply #17
if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none.  if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order.  sounds like your wav file needed --channel-map=none and it encoded ok with it.

The undocumented parameter --channel-map=none is used only to force Flac accept standard wav header instead WAVE_FORMAT_EXTENSIBLE wav header. Then a correct mapped wav (FL-FR-FC-LF-BL-BR) with standard header can be used with:
flac --channel-map=none standard_header.wav -o correct_mapped.flac

Quote
I don't use foobar much so I don't know ...

Foobar sends (STDOUT->STDIN) uncompressed data with a standard wav header (we can force bitdepth, channel-mapping, samplerate,... with DSP functions but not use a WAVE_FORMAT_EXTENSIBLE wav header).

Then for use flac multichannel output with Foobar always need the --channel-map=none undocumented parameter, sorry.

EDIT:
Maybe --channel-map=0x3F can be used to send flac the correct MaskChannels?
The only significative difference betwen standard and WAVE_FORMAT_EXTENSIBLE header is this field.

encoding 6-channel WAV to FLAC

Reply #18
well this is a big WTF.  i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4.

Aha, confirmed

Flac.exe from the flac-1.2.1b.exe package produces broken 24bit flacs. Foobar2000 0.9.4.4 won't play it, Winamp 5.35 will play with skips.

Edit. Channel count and samplerate don't matter, all 24 bit audio is affected.
ok, I have just finished checking into this.

first, it is not generating corrupt files.  second, this behavior should occur with certain 24bit files on any flavor of flac-1.2.1, including both versions of the installer.

what is happening is that the encoder is taking advantage of 1.2.x features to encode the 24bit file more efficiently.  this was not supposed to be released yet to give s/w more time to update to a 1.2.x decoder, but was picked up by a CVS merge that was too broad.

probably the reason it's not playing in foobar is the decoder is pre-1.2.x, but it could also be related to how it handles 6ch FLAC files.

I am going to post this info to the 'flac 1.2.1 released' thread soon, please follow up with any questions regarding this specific problem there.

if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none.  if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order.  sounds like your wav file needed --channel-map=none and it encoded ok with it.
The undocumented parameter --channel-map=none is used only to force Flac accept standard wav header instead WAVE_FORMAT_EXTENSIBLE wav header.
all --channel-map=none does is to not try and figure out the channel order, instead encoding channels as the same order they appear in the input.  if the input is WAVEFORMATEXTENSIBLE it will also save the channel mask in a tag.

Maybe --channel-map=0x3F can be used to send flac the correct MaskChannels?
The only significative difference betwen standard and WAVE_FORMAT_EXTENSIBLE header is this field.
that won't work, --channel-map is intended to specify the channel assignments in a format-independent way, but only --channel-map=none is currently implemented.

there may be a --channel-mask option in the future for use with old WAVEFORMATEX multichannel files which will automatically reorder the channels to FLAC order if possible.

Josh

 

encoding 6-channel WAV to FLAC

Reply #19
second, this behavior should occur with certain 24bit files on any flavor of flac-1.2.1

Flac.exe from the "flac-1.2.1-win.zip" is not affected, dunno why:
Quote
Sample Rate : 48000 Hz
Channels : 6
Bits Per Sample : 24
Bitrate : 1642 kbps
Codec : FLAC
Tool : reference libFLAC 1.2.1 20070917
[/size]
The same file encoded with the "installer-shipped" version isn't playable.

what is happening is that the encoder is taking advantage of 1.2.x features to encode the 24bit file more efficiently.  this was not supposed to be released yet to give s/w more time to update to a 1.2.x decoder, but was picked up by a CVS merge that was too broad.

So, will you update the encoder (downgrade) until 1.2.x decoders are propagated enough? Otherwise, only Audition and the next version of Winamp would be compatible... (Or maybe, a Known issues entry?)

probably the reason it's not playing in foobar is the decoder is pre-1.2.x, but it could also be related to how it handles 6ch FLAC files.

foobar2000 0.9.4.4 is based on FLAC 1.1.0 decoder (ain't gonna be updated soon  ), and Winamp 5.35 is on 1.1.4. Though, next version of Winamp (5.36) will be 1.2.x-compatible.