Ok, sample file
(1):
http://www.sendspace.com/file/9b9iv6 md5 =
a8337fc85481ff8e7f017444b19f624f(DO NOT PLAY IT, it's just 4 channels of noise, 10 second total).
so starting out:
-
Get a copy of flac for the command line if you don't have one already (all further commands reference it).
- find what version of flac you have (I'm on 1.2.1)
flac -v
- (optional) test the ffp of the file:
e9e9fd77a00f963daf8ef1bd2d58b664
metaflac --show-md5sum multi-channel.flac
- decode the file to wav:
flac -d multi-channel.flac
at this point, open either the resulting wav file or the original flac file in your audio editor of choice. Here is what I started with in Audacity:
http://img121.imageshack.us/i/multi1g.jpg/Notice the difference between the noise channels (1&2) and the tone channels (3&4) and the volume differences. Also note the labels on the left hand side (L/R/Mono/mono). I did it this way so you can visually verify that things will map the way you want. Now, in Audacity, you can export multi-channel flac files natively, and that's ok, right as you're exporting, you end up being asked (unless you've selected not to in the preferences) how you want to map the channels (see below, again, note labels) and presto, it churns away for a bit (depending on size) and you have a multi-channel flac.
http://img11.imageshack.us/img11/4663/multi2g.jpgNow, if you export to wav, you have a few more steps. Unfortunately when you export to wav (Audacity) doesn't use the mapping algorithm that flaclib is expecting so it barfs which I'm insinuating is sort of what happened with TLH and possibly with your audio editor of choice. (Here's what flac chucks back at me when I try it)
multi-channel.wav: ERROR: WAVE has >2 channels but is not WAVE_FORMAT_EXTENSIBLE; cannot assign channels
So what I did was I set flac to ignore the channel mapping and just assign stuff arbitrarily/unordered.
flac --best --channel-map=none -V multi-channel.wav
I've played with it a bit and I get the same results
(2) that I got in the flac file out of Audacity which was mapped (or I think it was mapped at any rate, it worked) and I've decoded it via both Audacity and flac separately and compared the results with satisfaction(3) (in so far as it kept the order displayed as I had intended regardless of stereo association or poly-mono). I suggest you play around with your editor and see if 1) It will export flac natively and what happens when you do. 2) make sure you get satisfactory results if you do it by hand as shown above. One caveat is by using no channel mapping, you get 4 mono tracks, it doesn't keep the stereo association so make a note in your text file (or in the flac metadata, whatever floats your boat) what tracks are what.
Now, for bonus points, you could figure out how to do surround-sound and include those mappings so when you do a 4ch/5.1ch recording to encode it as a single flac file, but it would require you to figure out two things. A) What mapping settings to use presuming MicroSoft's WAVE_FORMAT_EXTENSIBLE setting is truely the "industry standard" which it seems to be even though very few use it and B) that your playback will read both the flac file and the mapping correctly and if there is any nuance there. That's a lot of work IMHO (without doing it as a job), but it's
possible. Audacity might do it, I don't know.
Footnotes:
(1) - If someone really wants me to, I'll upload the poly wav file I have, but I figured you could decode it. If you run into problems let me know.
(2) - I experienced some differences in the flac files of about 10kb, which is a hill of beans in a 1.7mb file, but it tells me that there is something different when doing it by hand and doing it via Audacity. That 10kb may be a mapping code irregularity, it may be a different flaclib, I don't know, but I know it works both ways so I didn't pursue it.
(3) - I did the following off of that original wav file:
- Encode with audacity using it's mapping (testA)
- Encode with flac without mapping (testB)
- Decode testA using flac, verify resulting wav in Audacity
- Decode testA using Audacity
- Decode testB using Audacity (I got lazy, figured if it worked I was happy)
- Import original wav file into Audacity
(4) - This took longer to type up than I had expected...