5.1声道转化为左右声道downmix
http://szfzafa.blog.163.com/blog/static/11895416720120724729214/
标题:
Downmix 5.1ch to 2ch in AVS
最简单:
function Dmix6Stereo(clip a) { # 6 Channels L,R,C,LFE,SL,SR
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3694, 0.2612) #忽略低音增强 不模拟相位差
blr = GetChannel(a, 5, 6)
return MixAudio(lrc, blr, 1.0, 0.3694)
}
左声道
=L*0.3694
+
C*0.2612
+
SL*0.3694
右声道
=R*0.3694
+
C*0.2612
+
SR*0.3694
function Dmix6Dpl(clip a) { # 6 Channels L,R,C,LFE,SL,SR
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3205, 0.2265) #忽略低音增强 模拟相位差
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2265, 0.2265) #把SL,SR都当作S处理了,用于SL,SR音源位置相同或相近
sr = MixAudio(bl, br, -0.2265, -0.2265)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
左声道
=(L*0.3205+C*0.2265)
+
(SL*0.2265+SR*0.2265)
右声道
=(R*0.3205+C*0.2265)
-
(SL*0.2265+SR*0.2265)
function Dmix6Dpl2(clip a) { # 6 Channels L,R,C,LFE,SL,SR
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3254, 0.2301) #忽略低音增强 模拟相位差
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2818, 0.1627) #后向音源模拟相位差的混合幅度减小
sr = MixAudio(bl, br, -0.1627, -0.2818) #用于SL,SR音源位置相距有一定距离,但有并非正左正右
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0) #个人认为这样混合更合理
}
左声道
=(L*0.3254+C*0.2301)
+
(SL*0.2818+SR*0.1627)
右声道
=(R*0.3254+C*0.2301)
+
(SL*(-0.1627)+SR*(-0.2818))