我想隔离人声和删除mp3文件中的背景音乐。我不需要完全摆脱背景音乐,但至少要把它最小化。在
我尝试了pydub
,这有助于音频操作。我尝试了这个代码,删除人声和保留背景音乐。我需要做相反的事。我试着切换声音的单声道和反转另一个声道,但也没用。在
from pydub import AudioSegment
from pydub.playback import play
# read in audio file and get the two mono tracks
sound_stereo = AudioSegment.from_file(myAudioFile, format="mp3")
sound_monoL = sound_stereo.split_to_mono()[0]
sound_monoR = sound_stereo.split_to_mono()[1]
# Invert phase of the Right audio file
sound_monoR_inv = sound_monoR.invert_phase()
# Merge two L and R_inv files, this cancels out the centers
sound_CentersOut = sound_monoL.overlay(sound_monoR_inv)
# Export merged audio file
fh = sound_CentersOut.export(myAudioFile_CentersOut, format="mp3")
有人知道怎么解决这个问题吗?谢谢!在
如果您的
sound_CentersOut
已经删除了人声,为什么不使用sound_CentersOut
的倒置形式对您的sound_stereo
应用相位消除?在请注意,大多数歌曲的中心都有人声和低音,因此您的人声中也可能包含低音。如果你真的想做手术,你可能需要做一些平衡来滤除低频。在
相关问题 更多 >
编程相关推荐