2017-05-27 118 views
2

當我運行這段代碼:Python Pydub權限被拒絕?

from pydub import AudioSegment 
sound = AudioSegment.from_mp3("i.mp3") 
sound.export("F:\\bh", format="wav") 

一個ffmpeg的窗口彈出,我得到這個錯誤:Error Pic

即使我用管理員privilleges運行: Error with admin privilleges

Note :
The error occurs on every location that I try to export

+1

同樣的問題,沒有解決方案 – Macumbaomuerte

+0

您是否找到解決方案? @匿名 – lalithkumar

回答

0
from pydub.playback import play 
from pydub import AudioSegment 
AudioSegment.converter = r"C:\\ffmpeg\\bin\\ffmpeg.exe" 
AudioSegment.ffmpeg = r"C:\\ffmpeg\\bin\\ffmpeg.exe" 
myAudioFile = 'C:\\Users\\User\\Documents\\UNDAR\\CepreUNDAR\\Shema.mp3' 
print(myAudioFile) 
sound_stereo = AudioSegment.from_mp3(myAudioFile) 
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 
myAudioFile_CentersOut = "ShemaDrumless.mp3" 
fh = sound_CentersOut.export(myAudioFile_CentersOut, format="mp3")