ash*_*ish 4 python algorithm audio voice signal-processing
我的问题是关于如何继续使用python语言提取音乐中的人声,但我提取了背景音乐
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")
Run Code Online (Sandbox Code Playgroud)
我需要在歌曲中提取人声
如果不是这样,那么如何从另一个音频文件中减去一个音频文件
小智 5
您始终可以使用librosa库,该库是python中音频处理的常用库。这有助于将人声(和其他零星的前景信号)与随附的乐器分开。
https://librosa.github.io/librosa_gallery/auto_examples/plot_vocal_separation.html
它采用切片并绘制相同的切片,但分为其前景和背景