This guide is mainly written for movies, but u can use it for DJ-music too.

Requirements:
1. Tools:
i. Audacity, - Get it here
ii. BeHappy along with avisynth and SOX Filter (V.Imp), - Get it here
iii. AC3 Tools Pro, - Get it here
2. Minimum 20GB Free Space.
3. Around 4-6hrs Free Time.
Recommended: Viewing the movie atleast once completely before working on it.

Note: BeHappy uses avisynth script to work, if u dont have it already installed then Get it Here and copy the contents of 'plugins' folder to "\AviSynth 2.5\"plugins folder

Notations used throughout this guide:
1. Parent audio - The audio language to which the movie originally belongs e.g. Harry Potter originally belongs to English language.
2. Child audio - The audio language in which the movie is dubbed and which you want to upmix to 5.1 channel.
3. 5.1ch - 5.1 channel audio(with surround) used mainly in DVDs and Blu-Ray Discs.
4. 2ch - conventional 2 channel audio(stereo) used widely in VCDs,Audio CDs,A/V Streaming and File formats like MP3,WMA etc.

Now Lets get started.
I demonstrate the case by considering an example of movie - Harry Potter & The Deathly Hallows dubbed in Hindi(an Indian Language). The movie is originally in English so my Parent audio is English and my Child audio is Hindi
Briefing:
In a 5.1ch audio the Center-channel contains majority of voice (dialogs) and surround is created by back and side channels along with LFE (Woofer). So we can replace the Central channel and overlap the side channel voices of one audio file with that of other leading to overwhelming of child audio's voice over parent's along with perception of surrounding effects from Back Channels and Woofer.
Another thing is that the Dubbed lingual VCDs or DVDs released of new movies these days is actually down-mixed from 5.1ch to 2ch thereby preserving 60-70% of Surround information in them. So if we Up-mix them then they don’t produce bad effects.

Prerequisite:
First thing is to get good quality Dubbed audio(generally from original VCDs) and Parent audio (Generally from DVDs or better Blu Rays). Then play and test both files audio properties and check to see for the following:

1. Both files should have same sample rate(e.g 48kHz) & frame-rate along with pitch and tempo. Play both one after other in a player like vlc to verify this. Its not necessary that if both audios are of same frame-rate then they would match in pitch as well.

2. There should be no big delays in two files. Small amount(<50ms) is tolerable but large delay will give problem while working in Audacity.
If u find above 2 problems don’t worry these can b fixed with BeHappy which I have explained in later part of guide.

After you have both the audios next step is demuxing the 5.1ch audio into independent mono waves to be worked upon. You can use AC3 Tools pro to demux audio if it is ac3 otherwise use Behappy(recommended) for dis purpose.
Initially try this for small duration audio clips like 5 or 10 min, later u can repeat the procedure for entire movie. Use tools like mkvmerge for cutting first 5-10min of audio from movie file.

Demuxing The Parent(English) audio
Open BeHappy and select input source as:
i) “Direct show source” if u r loading audio directly from video.
ii) AC3, mpg etc if your file is independent audio in formats – ac3, mp3 etc

Then give source file path…Destination File path will be automatically generated but u can set it too. A good idea is to put it into separate folder with name "PARN" for Parent audio and "CHLD" for Child audio, which is “ENG” for English audio and “HIN” for hindi audio in this case.
At the bottom select encoder type as “WavSplit @Mono Wavs” – the last option of drop down menu list.
Click on En-queue

Next click start. It will start its job and show progress @ the bottom in bar.


Once completed, u will find that 6 wave files are created in the destination folder u specified. These are 6 independent sound files containing all information of 6 channels:
1. Center (Majority of voice content)
2. Front Left & FrontRight(Contains mainly musical Score, Front channel effects with sideline dialogs of certain scenes)
3. Back Left & Back Right(Contains mainly surround effects and Back-line dialogs, if any)
4. LFE (Low Frequency Effects i.e. Woofer TruBass)

Upmixing and Demuxing The Child(Hindi) Audio
Similar to previous step only change is that u have to tick the option “5.1 Up mix” and configure the upmixing profile. I recommend using the profile “Farina” but u can try other profiles too.



NOTE: If your audio is of high volume then directly upmixing it may result in artifacts so to avoid it youu should de-amplify your audio by some amount like -3db.


If ur audio requires pitch changing then u can do it as :



The SOX Filter of Behappy will work on your 2ch audio going through various transformations and applying various filters to sample out respective channels.
If you are in the testing phase then in addition to above step, I recommend that u create a direct 5.1ch audio from 2ch stereo file for comparing it with the audio that u are going to create later in final step.
To do this select encode type as “Nero AAC” or “Aften AC3” to create a direct 2ch to 5.1ch upmixed audio file. You can play it and see it will be a 5.1ch audio file but with little to no effects.



Preparing Channels
OK so u have both the audios in demuxed wave forms.
The Central channel of your Hindi audio(Child audio) will be used as it is without any change.
To prepare Front & Back Channels open Audacity and import the Front Left & Right Channels of both Hindi and English audio in it.

First load the English audio front left right channels by drag/dropping the wave files into audacity or by file menu.when they r imported a waveform would be generated.By default they would be imported as “mono” so u need to make right channel as “Right" and left channel as “Left” as shown in above screenshot.
Distortion: You might notice that there is heavy distortion in the above two Front Left & Right channels, this is because I did not De-Amplify the 2ch audio @ the time of upmixing, which resulted in artifact. If this happens then go back to previous step and de-amplify ur audio while upmixing.

Next import hindi audio Front left and Front right waves into audacity similarly and mark there channels as “Right” & “Left” from default mono resp. You can play n check now and notice that Hindi audio would be overlapped with English audio.

IMPORTANT: When u play the audio,If u notice some abrupt discrepancies like ringing or Doppler-effect or Phasing etc then it cud be due to 1 or more of the following reasons:

a) Your 2 audio files don’t match in start points or duration.
Remedy- Delay/Advance one of the files by cutting of start frames i.e. milliseconds of audio in the frequency spectrum of the Left/Right channels shown by Audacity… Start with 100ms and apply Trial and Error method.

B) Your 2 audio files don’t match in pitch-response, Rate, Tempo etc. This is highly possible if ur hindi audio is frm VCD becasue sometimes VCD releasers don’t perfectly change frame-rates of audio. When they Timeshift, they change only Tempo to sync with video while the pitch rate are of 24fps only. Eg. in all the Harry potter movies released in vcd the hindi audio is having pitch & rate levels of 24fps only.
Remedy- Go back to previous step and when demuxing Hindi audio select option – “TimeShift” and configure it to “Framerate based Tranform 24 -> 25” with effect- “Pitch change preserving Tempo” i.e. middle option. This will change pitch level of your audio while preserving Tempo (framerate) i.e. its duration will not change

Next job is to select regions where Front channels of English audio have voice contents(dialogs) and attenuate that region. only that region

Select the region of left & right channels of English audio only and go in options and click amplify, specify value as -24db to reduce gain in dat region. Similarly u can attenuate Hindi audio at regions where there is heavy music n effects, but it isn’t very much needed. Our main stress is on reducing English voice levels .
Optional: u can try different effects and filters present in audiocity like equ,HPF,LPF,FFT,Dynamic range etc

You might ask a question "How would I know which region contains voices". Well u can judge it by looking @ the spectrum of channels in audacity provided u have viewed the movie once before.



When working on audacity remember dat u can play and check at every stage.if something goes wrong then audacity provides option to “undo” ur last move.
Save ur file frm menu using “Export to wave” and give name to it as”FinalFront.wav”,"FinalBack.wav" etc.
Repeat the above step for Back channels i.e BL/BR. And LFE.

NOTE: If your movie doesn't contain high amount of voices in back channel den u can skip the above step & use the English back channels & LFE directly.

Finalization and Remuxing into single 5.1ch audio file.
For this we can use Nero Sound Trax but I Highly recommend using ac3 tools pro as its easier to handle and gives much better results. It is not a freeware and u won’t find its license anywhere. It is 15 day trial but Its fully functional and there’s 1 trick by which u can use it as long as want to. The Trick is remember ur date of installation, type it up in a text file if u want and when trial period expires set your clock back to the date of installation. It will work normal as Trial version again so u can work on it and restore your clock back 2 normal after your job is done and when u want to use it, set your clock back to date of installation. B)

Open AC3 Tools Pro

Click on create ac3, select ac3 mode as : 5.1, set bitrate as 384 or 448kbps,Frequency as 48khz.Give independent paths to ur newly created mono and stereo waves .specify output directory.click on start.

Upon completion play it and test its performance with original 2ch hindi audio and 5.1 upmixed audio by sox filter of Behappy. You can also try Downmixing it to 2ch using BeHappy to test its playback comparing to original 2ch file.

If u did everything right then u will find that the newly created audio file contains almost 90% of effects that u find in Parent audio(English in our case). The only thing that won’t be present is voice effect like echoes which are there in English. This is because the audio dubbing is done such that.

From here its up to you to decide what u wanna do with the ac3 u created. You may mux it up into ur video file as it is, or u may consider converting it to AAC (advanced audio coding) using Nero aac enc present in Behappy. If u find that the volume is very low then u can consider amplifying it in Behappy.

If u wish to convert it to AAC then use Behappy and select Nero AAC encoder with quality parameter as 0.35 or more. Converting to AAC will reduce about 20% of File size @ same quality. E.g. 0.35 Quality factor in AAC normally yields about 290-300kbps Avg. Bitrate and 0.4 QF will give about 350-360kbps Avg. bitrate. However this can vary if your audio is amplified.


If u find this guide useful then add rep. If u find this guide useless then PM me
-Ujjawal K.

~Bright