Skip to main content

Topic: Format options defaults (Read 3308 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • JJZolx
  • [*][*][*][*]
Format options defaults
I'm looking at a program which uses Flac encoding in a transcoding operation, and trying to figure out what the options listed below do.  Do they tell Flac about the format of the input or what to produce in its output?

Are there default values for each of these?

Code: [Select]
format options:
      --endian={big|little}    Set byte order for samples
      --channels=#             Number of channels
      --bps=#                  Number of bits per sample
      --sample-rate=#          Sample rate in Hz
      --sign={signed|unsigned} Sign of samples (the default is signed)
  • Last Edit: 19 October, 2008, 01:07:35 PM by JJZolx

  • Egor
  • [*][*][*][*][*]
Format options defaults
Reply #1
These options are for RAW input only, i.e. WAV without a header.

There is no default value - for each option you must specify a value, but I can give some hints:

Endian is little for Windows machine,
bps is 16 for a CD-Audio content
sample rate is 44100 Hz for CD-Audio
sign is signed most probably.

  • JJZolx
  • [*][*][*][*]
Format options defaults
Reply #2
These options are for RAW input only, i.e. WAV without a header.

There is no default value - for each option you must specify a value, but I can give some hints:

Endian is little for Windows machine,
bps is 16 for a CD-Audio content
sample rate is 44100 Hz for CD-Audio
sign is signed most probably.


Thanks.  That's how it's being used.  The output is WAV from LAME, with no header (long story why it's transcoding Mp3 to Flac, but it's necessary).

So these option _must_ be specified, or else Flac will have no idea what to do and will fail or ... will it?  I would have thought that it would default to assuming redbook CD format of 2ch/16bit/44.1kHz.

Should --force-raw-format also be given, or will it matter?

  • Nick.C
  • [*][*][*][*][*]
  • Developer
Format options defaults
Reply #3
Should --force-raw-format also be given, or will it matter?
If the stream has no WAV chunks in it, only raw audio, then --force-raw-format is unnecessary.
lossyWAV -q X -a 7 -A 0.586740 --feedback 5| FLAC -5 -e -p -b 512 -P=4096 -S- ~= 314kbps

  • JJZolx
  • [*][*][*][*]
Format options defaults
Reply #4
What does this bit mean, from the detailed Help?

Quote
flac checks for the presence of a AIFF/WAVE header to decide whether or not to
treat an input file as AIFF/WAVE format or raw samples.  If any input file is
raw you must specify the format options {-fb|fl} -fc -fp and -fs, which will
apply to all raw files.  You can force AIFF/WAVE files to be treated as raw
files using -fr.


There's no documentation of -fb -fl -fc -fp -fs or -fr options.  Can I assume these are short forms of --endian big, --endian little, --channels, --bps, --sampe-rate and --force-raw-format, respectively?  Or is this an outdated bit of documentation?
  • Last Edit: 19 October, 2008, 11:34:43 PM by JJZolx

  • jcoalson
  • [*][*][*][*][*]
  • Developer
Format options defaults
Reply #5
oops, the -fs, etc options are ancient short forms of the new long options (gotta fix that)
-fs = --sample-rate
-fc = --channels
-fp = --bps
-fb = --endian=big
-fl = --endian=little

flac tries to detect wave/aiff from the file header.  if it does not see a valid header it assumes raw samples, in which case you have to specify all those options (and --sign=...) so it knows the raw format; it doesn't make any assumptions about it.

you only have to use --force-raw-format if the detection fails (which I've never heard of).  but it won't hurt to use it if you know you're feeding it raw samples.