Я пытался уменьшить или увеличить громкость аудиоклипа с помощью pydub
. Но когда я так сделал, выдает следующую ошибку.
c:/Users/KalyanDk/vsprojects/Games/playsound.py
C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\utils.py:165: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\utils.py:179: RuntimeWarning: Couldn't find ffplay or avplay - defaulting to ffplay, but may not work
warn("Couldn't find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning)
Traceback (most recent call last):
File "c:/Users/KalyanDk/vsprojects/Games/playsound.py", line 12, in <module>
play(louder_song)
File "C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\playback.py", line 71, in play
_play_with_ffplay(audio_segment)
File "C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\playback.py", line 18, in _play_with_ffplay
seg.export(f.name, "wav")
File "C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\audio_segment.py", line 780, in export
out_f = _fd_or_path_or_tempfile(out_f, 'wb+')
File "C:\Users\KalyanDk\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\utils.py", line 57, in _fd_or_path_or_tempfile
fd = open(fd, mode=mode)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\KalyanDk\\AppData\\Local\\Temp\\tmposf_nhdb.wav'
Я не могу понять, что не так .. Вот мой код
from pydub import AudioSegment
from pydub.playback import play
song = AudioSegment.from_wav("Bounce.wav")
louder_song = song + 6
quieter_song = song - 3
play(louder_song)
louder_song.export("Bounce.wav", format='wav')'''
И аудиофайл в той же папке, где находится текущий файл python.