tebasuna51
22nd January 2008, 16:32
guys im writing this script (the movie has stereo sound)
DirectShowSource("d:\movie.avi")
and save as movie.avs
it is possible to upmix to 5.1 the sound with script? please help, im new...
There are 6 scripts in BeHappy to upmix 2 -> 5.1 using Sox functions (http://forum.doom9.org/showthread.php?p=761154#post761154)
function UpDialog(clip a)
{
# Audio with mostly dialog (ie. Comedy, Drama)
# Profile to use with audio sources that have mostly mono content. 20ms delay and -3db attenuation on surround
# Note: the center channel is very weak for this profile
front = a.soxfilter("filter 20-20000")
back = a.soxfilter("filter 100-7000")
fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.794,-0.794)
fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),0.794,-0.794)
cc = mixaudio(mixaudio(front.GetLeftChannel(),fl,1,-1),mixaudio(front.GetRightChannel(),fr,1,-1),0.224,0.224)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.596")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.562,-0.562)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.562,-0.562)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
######################################################
function UpAction(clip a)
{
# Audio with a mix of sounds (ie. Action, Adventure)
# Profile to use with audio sources that have a wider range of sound content. 20ms delay and -3db attenuation on surround
# Note: General purpose profile
front = a.soxfilter("filter 20-20000")
back = a.soxfilter("filter 100-7000")
fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.668,-0.668)
fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),0.668,-0.668)
cc = mixaudio(mixaudio(front.GetLeftChannel(),fl,1,-1),mixaudio(front.GetRightChannel(),fr,1,-1),0.398,0.398)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.447")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.473,-0.473)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.473,-0.473)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
######################################################
function UpGerzen(clip a)
{
# Gerzen Profile
# Gerzen approach Profile modified with 20ms delay and some attenuation on surround
front = a.soxfilter("filter 20-20000")
back = a.soxfilter("filter 100-7000")
fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.885,-0.115)
fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),0.885,-0.115)
cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.4511,0.4511)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.5")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.668,-0.668)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.668,-0.668)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
######################################################
function UpFarina(clip a)
{
# Farina Profile
# Farina/Sursound approach Profile M=L+R, S=L-R, c=0.75, L' = (1-c/4)*M+(1+c/4)*S, C' = c*M, R' = (1-c/4)*M-(1+c/4)*S
# also added with 20ms delay and some attenuation on surround
front = a.soxfilter("filter 20-20000")
back = a.soxfilter("filter 100-7000")
fl = mixaudio(mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.500,0.500),mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.500,-0.500),0.8125,1.1875)
fr = mixaudio(mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.500,0.500),mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.500,-0.500),0.8125,-1.1875)
cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.375,0.375)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.5")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.668,-0.668)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.668,-0.668)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
######################################################
function UpMultisonic(clip a)
{
# Multisonic Profile
# Multisonic approach Profile modified with 20ms delay and some attenuation on surround
front = a.soxfilter("filter 20-20000")
back = a.soxfilter("filter 100-7000")
fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),1,-0.5)
fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),1,-0.5)
cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.5,0.5)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.5")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.668,-0.668)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.668,-0.668)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
######################################################
function UpSoundOnSound(clip a)
{
# Sound On Sound Profile
# SOS approach Profile with 20ms delay and some attenuation on surround
back = a.soxfilter("filter 100-7000")
fl = a.GetLeftChannel()
fr = a.GetRightChannel()
cc = mixaudio(a.GetRightChannel(),a.GetLeftChannel,0.5,0.5)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.5")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.668,-0.668)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.668,-0.668)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
return MergeChannels( fl, fr, cc, lfe, sl, sr)
}
# Sample Call function
2==AudioChannels(audio)?UpAction(audio):audio
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.