Help - Search - Members - Calendar
Full Version: Multichannel FLAC
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
mandel
Has anybody had any luck making multichannel FLAC files. I wish to store hi-res quad audio but the software I have makes 6 channel extensible wave files that FLAC seems to choke on. This is what I get when I try to encode them in FLAC frontend...

QUOTE
options: -P 4096 -b 4608 -m -l 12 -e -q 0 -r 0,6
interleaved.wav: WARNING: found non-standard 'fmt ' sub-chunk which has length =
40
interleaved.wav: ERROR: unsupported compression type 65534


Is it possible to make 4 channel wave files that aren't in extensible format? If so, using what? Should FLAC support extensible? blink.gif
bryant
QUOTE(mandel @ May 20 2005, 11:37 AM)
Is it possible to make 4 channel wave files that aren't in extensible format?  If so, using what?  Should FLAC support extensible?  blink.gif
*


Yes, the last time I checked FLAC does have a problem with the extensible wav files. I think I've also read that Microsoft consideres wav files with more than 2 channels that don't have the extensible header as "broken" because there's no way to specify the channel assignment. Until recently, however, the only extensible wav files that existed were samples on Microsoft's website! I suspect that FLAC will get support for this soon.

In the meantime, you have three choices:
  • Find a program that produces wavs without the extensible header (which should not be hard because this is still common).
  • It would be easy (although tedious) to manually patch the wav file to have a standard header plus a dummy chunk (which FLAC would warn about, but still encode).
  • Don't compress, or use a lossless compressor that handles the extensible format (like TTA, WMA, or WavPack).
Good luck! smile.gif
mandel
I have had a job trying to find a program that allows me to make quad files, extensible or not. All I can make is 6 channel extensibles in Audition...

Non-compressed 24/96 quad files would be huge and though WavPack compresses them fine, the playback plugin for Winamp results in downmixing (which is odd as I can play the original 6 channel waves in winamp fine). Guess i'll just have to wait until FLAC get around adding extensible support blink.gif
Mono
I don't suppose it would be possible to encode to WavPack and then transcode to FLAC?
mandel
I doubt that would help (if even possible) as WavPack is storing it in the extensible format that FLAC doesn't like.
jcoalson
you can pipe raw input to flac.exe

but no plugins I know will play >2 channels.

Josh
Case
QUOTE(jcoalson @ May 21 2005, 11:54 PM)
you can pipe raw input to flac.exe

but no plugins I know will play >2 channels.

Josh
*



Foo_flaccer can encode and foo_flac can decode multi channel files. But are there any specifications about channel mapping? Right now the channels are just encoded and decoded using same order as Windows.
jcoalson
QUOTE(Case @ May 22 2005, 03:29 AM)
But are there any specifications about channel mapping?

no, not yet. the only guarantee is that they come out in the same order that they went in to the encoder.

Josh
pest
i always wonder why some lossless encoders don't support the simplest
extensions of the wave-format, this is 10min coding work...


rolleyes.gif
jcoalson
QUOTE(pest @ May 25 2005, 04:45 AM)
i always wonder why some lossless encoders don't support the simplest extensions of the wave-format, this is 10min coding work...

excellent... I look forward to your patch.
thanks,
Josh
pest

CODE

fmt_chunk *io_wave::parsefmtchunk(wave_chunk *chunk,_uint32 id,_uint32 size)
{
   _fmt_chunk *fmt=new _fmt_chunk;
   if (!fmt) return NULL;

   char *cbuf=chunk->data;
   if (!cbuf) return false;

   int itmp;

   fmt->extrabytes = 0;
   fmt->chkid = id;
   fmt->size  = size;

   fmt->compcode = f_io->Read_U16Bits_LowHigh(cbuf);
   fmt->numchannels = f_io->Read_U16Bits_LowHigh(cbuf+2);
   fmt->samplerate = f_io->Read_U32Bits_LowHigh(cbuf+4);

   fmt->avgbytespersec = f_io->Read_U32Bits_LowHigh(cbuf+8);
   fmt->blockalign =  f_io->Read_U16Bits_LowHigh(cbuf+12);
   fmt->bitspersample = f_io->Read_U16Bits_LowHigh(cbuf+14);

   if ( (fmt->size-16 > 0) && (fmt->compcode != 1))
   {
     fmt->extrabytes = f_io->Read_U16Bits_LowHigh(cbuf+16);
   }

   if (fmt->compcode==WAVE_FORMAT_EXTENSIBLE && fmt->extrabytes) // wave-format extensible
   {
     fmt->wValidBits     = f_io->Read_U16Bits_LowHigh(cbuf+18);
     fmt->dwChannelMask  = f_io->Read_U32Bits_LowHigh(cbuf+20);
     fmt->wSubType       = f_io->Read_U16Bits_LowHigh(cbuf+24);
   }

   itmp=fmt->numchannels * fmt->bitspersample/8;
   if (fmt->blockalign!=itmp) fmt->blockalign=itmp;
   itmp = fmt->blockalign*fmt->samplerate;
   if (fmt->avgbytespersec != itmp) fmt->avgbytespersec=itmp;

   return fmt;
}




wink.gif
rjamorim
LOL
mandel
Pest> Now tell me how to compile FLAC with that extra code in and your work here will be complete shifty.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.