View Full Version : How to merge 8 mono waves into 1 multichannel 7.1 wave ?
Music Fan
5th December 2009, 13:59
Everything is in the title.:)
For 5.1 wave, I use BeSweet, but I believe he can't recognize 7.1 mux.
I read that avisynth could do that, but which program can open the avisynth script and make a multichannel wave ?
Or anything else than avisynth, it doesn't matter.
Thanks ;)
Midzuki
5th December 2009, 14:31
Avisynth + SoundOut plugin; OR...
Avisynth +wavi.exe; OR...
interlx; OR...
sox; OR...
multiwav;
SeeMoreDigital
5th December 2009, 18:08
I use WaveWizard...
Music Fan
6th December 2009, 18:20
Thank you guys !
Wave Wizard seems to be the easiest solution, but I can't find the good channels order to make an AVCHD with MultiAVCHD (same audio formats than Blu-ray).
First, I tried this (order in which I load the files in Wave Wizard) ;
FL, FR, C, LFE, BL, BR, SL, SR but it's not good because I hear the surround back in my side speakers and inversely.
Thus I changed the order and tried this ;
FL, FR, C, LFE, SL, SR, BL, BR and it's not good either !
In this order, the other channels are also in another order, but the surround back look good. :confused:
Skelsgard
6th December 2009, 18:56
use this order in WaveWizard
FL-FR-FC-LFE-BL-BR-SL-SR
and set WaveFormatEx as Output Format.
Then, open the output file in a hex editor and go to line 00000020, offset 08 and 09 and replace the values with 3F 06, something like this:
http://i49.tinypic.com/hwmzw1.jpg
"3F 06" is the setting for 7.1 Dolby order
With this, you'll hear each sound coming from the proper speaker.
Good luck!
Later :cool:
P.S. in case you wonder, the hex editor is "HxD Hex Editor".
Music Fan
6th December 2009, 19:20
Thanks a lot !
But it's not for Dolby, just PCM. Why do we have to apply a Dolby setting for PCM ?
A few minutes before to read your message, I found the good order for Wav (and not WaveFormatEx that I didn't know) ;
FL, FR, C, LFE, SL, SR, BL, BR.
Actually, I tested in 6.1, thus I can't verify if the surround back are in the good order because they are both mixed in the same speaker (mono surround back), but I guess it's good.
Music Fan
6th December 2009, 21:27
I just realize that the good order is the same than the second one (that didn't work) in my message written at 18:20. :confused:
Skelsgard
7th December 2009, 02:47
Thanks a lot !
But it's not for Dolby, just PCM. Why do we have to apply a Dolby setting for PCM ?
A few minutes before to read your message, I found the good order for Wav (and not WaveFormatEx that I didn't know) ;
FL, FR, C, LFE, SL, SR, BL, BR.
Actually, I tested in 6.1, thus I can't verify if the surround back are in the good order because they are both mixed in the same speaker (mono surround back), but I guess it's good.
It's called Dolby order in Micro$oft website but it doesn't mean anything else than a name, it all comes down to understanding and using the proper mapping when using WaveFormatEx.
WaveFormatEx allows you to map almost any given combination of speakers up to 18 positions.
An hex value is asigned to each channel position, and to obtain a given mapping you just need to sum the hex values of all channel positions and then apply that value to the hex header of your Wave_Format_Extensible file.
Wavewizard will give you a "blank mask" WaveFormatEx WAV file, whose header you can modify to change that blank mask into a "multichannel mapping mask".
This is the value for each channel position:
http://i50.tinypic.com/n2le8i.jpg
But although each channel has a unique value, still they're forced to an order when muxed, because it assumes that the channels are following the Wave_Ext order.
The order is shown in the image:
FL-FR-FC-LFE-BL-BR-FLC-FRC-BC-SL-SR-TC-TFL-TFC-TFR-TBL-TBC-TBR
You can create a 2ch file and make it play thru the BR and LFE speakers with no sound coming from any other position by just setting the proper masking, but still the BR channel will have to be after the LFE channel in the mux because of such order.
A FL-FR-FC-LFE-BL-BR-SL-SR mapping file will use a masking of
1+2+4+8+10+20+200+400 = 063F (hex sum)
Invert the pairs (don't ask me why, it just happens to be that way) and you get 3F 06, the value of the 8ch mask for FL-FR-FC-LFE-BL-BR-SL-SR mapping.
Using the wavi method you can also set a masking when exporting.
This is a 48kHz/16bit/8ch WAVE_FORMAT_EXTENSIBLE speaker test file with FL-FR-FC-LFE-BL-BR-SL-SR order for you to test.
http://www.mediafire.com/?neycltm0xz1
Midzuki
7th December 2009, 04:41
A FL-FR-FC-LFE-BL-BR-SL-SR mapping file will use a masking of
1+2+4+8+10+20+200+400 = 063F (hex sum)
Invert the pairs (don't ask me why, it just happens to be that way) and you get 3F 06, the value of the 8ch mask for FL-FR-FC-LFE-BL-BR-SL-SR mapping.
The byte-order inversion simply means little-endianness.
Using the wavi method you can also set a masking when exporting.
Wavi.exe works with decimal values --- in this particular case, the channel mask is "1599".
Skelsgard
7th December 2009, 04:52
The byte-order inversion simply means little-endianness.
Thanks for clarifying :thanks:
Music Fan
7th December 2009, 09:41
Thanks a lot, very interesting !:)
1+2+4+8+10+20+200+400 = 063F (hex sum)
I don't understand how you obtain 063F with these numbers. For me, the sum is 645. :o
Sorry for this (stupid) remark but I don't know anything to Hex.:o
You can create a 2ch file and make it play thru the BR and LFE speakers with no sound coming from any other position by just setting the proper masking, but still the BR channel will have to be after the LFE channel in the mux because of such order.
Cool. Does it mean that we can create any combination (for example 2.1, 3.0, 4.0, 5.0, ...) and that all players and receivers will recognize it ?
And for 5.1, should we proceed in the same way with Wave Wizard or the obtained 5.1 wave is good without modification ?
Skelsgard
7th December 2009, 13:25
I don't understand how you obtain 063F with these numbers. For me, the sum is 645. :o
Sorry for this (stupid) remark but I don't know anything to Hex.:o
Hex is short for hexadecimal system. The decimal system uses a base 10 set of numbers. The hexadecimal system uses a base 16 set of numbers, from 0 to 9 plus letters A to F.
Hex: 0/1/2/3/4/5/6/7/8/9/ A / B/ C / D/ E / F/10/11/12/13/14/15/16/17/18/19/1A/1B/1C/1D/1E/1F
Dec: 0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28
So 8 units in the decimal system is 8 as well in the hexadecimal system, but 12 units in dec system is C in hex, 15 dec is F hex, 18 in dec is 12 in hex, 27 dec is 1B hex, and so on.
Start the calculator on you OS, set it to scientific mode, then set it to Hex, and add the values for all desired speakers. You'll get the number.
1599, as midzuki posted, is the decimal equivalent of the hexadecimal 063F.
Cool. Does it mean that we can create any combination (for example 2.1, 3.0, 4.0, 5.0, ...) and that all players and receivers will recognize it ?
Yeap. Any combination of speakers you can think of. Within the 18 possible speaker positions, of course.
Like, for example, a 4.0 file that is Front Right + Side Right + Back Right + LFE. The order would have to be FL-LFE-BR-SR and masking would be 2+8+20+400 = 42A
So 04-2A, inverted to 2A-04.
And for 5.1, should we proceed in the same way with Wave Wizard or the obtained 5.1 wave is good without modification ?
For 5.1, pretty much anything will work for encoders, not so much for players.
3 possible scenarios:
1) Wav PCM 6ch file, without masking info because it's not a WAVE_EXTENSIBLE_FORMAT file. Encoders assume multichannel WAV order and give a properly mapped encoded file (let's say Aften for Ac3 or neroaacenc for AAC). Players have no info to derive the mapping from so you only hear channels 1 and 2 played thru the front speakers or all channels played thru the front speakers.
2) WAVE_Ext file without masking. Encoders assume multich WAV order and encode properly.
Players don't get a mapping so same as 1
3) WAVE_Ext file with proper masking. Encoders recognize a proper 6ch file and encode accordingly. Some encoders might not support WAVE_Ext files and throw an error.
Players (pretty much all of them) get masking info and send each channel to the proper speaker position, sound on every intended speaker.
Receivers recognize the file, play it as intended and all is well in the kingdom of the lord. Tru for HDMI capable external receivers. Not for SPDIF-only capable receivers as SPDIF can't cope with uncompressed multichannel 5.1 WAV.
AFAIK, SPDIF supports 4-channel transmission of uncompressed WAV but no higher. I should test this myself.
Music Fan
7th December 2009, 13:59
Thanks a lot !
I will have to read it several times to understand well how it works.
Start the calculator on you OS, set it to scientific mode, then set it to Hex
I didn't even know that I could do that, it's the first time I see it.:)
1) Wav PCM 6ch file, without masking info because it's not a WAVE_EXTENSIBLE_FORMAT file. Encoders assume multichannel WAV order and give a properly mapped encoded file (let's say Aften for Ac3 or neroaacenc for AAC). Players have no info to derive the mapping from so you only hear channels 1 and 2 played thru the front speakers or all channels played thru the front speakers.
Don't you forget one scenario ?
Because I have no problem with the 5.1 wave that I created with BeSweet. My player is connected with Hdmi to my receiver.
Do you believe that a "check" with a Hex editor is though preferable even when it works on one player, because it could not work on another one ?
Skelsgard
7th December 2009, 17:01
I'm not sure that's not because BeSweet it's outputting a WAVE_Ext file.
It might.
But even so, if your HDMI receiver maps properly a WAV PCM header file without any masking info, then you don't need to bother setting up Wave_Ext files.
Save yourself the hassle, unless you really, really need to ensure compatibility with other players. Like software players, which were the ones I was referring to.
Hardware players are a completely different beast.
Still, I think, Im not sure, that for 8ch muxes you're gonna need the WAVE_Ext header with masking info.
Music Fan
8th December 2009, 16:07
Ok, thank you for all these explanations. ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.