gpt4 book ai didi

python - 有没有以下问题的解决方案

转载 作者:行者123 更新时间:2023-12-04 23:35:30 27 4
gpt4 key购买 nike

这是代码,我得到以下问题文件名是“ply_audio.py”

    from pydub import AudioSegment
># read/write data
> data = AudioSegment.from_file(file="one.wav",format="wav")
>data.export("new_test.wav")
> python ply_audio.py

C:\Users\raj\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\utils.py:170: 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\raj\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't
find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)

Traceback (most recent call last):
File "ply_audio.py", line 4, in <module>
data = AudioSegment.from_file(file="one.wav",format="wav")

File "C:\Users\raj\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 685, i
n from_file

info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)

File "C:\Users\raj\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)

File "C:\Users\raj\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,

File "C:\Users\raj\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified

最佳答案

您使用的库需要 ffmpeg(或 avconv)。我建议使用 ffmepg (但如果需要,您应该检查项目的许可证限制)。
您可以从 official 下载它然后确保 bin下载的 ffmpeg 应用程序的文件夹在您的路径中(例如,参见 https://www.wikihow.com/Install-FFmpeg-on-Windows)
然后您上面的代码将同时看到 ffmpeg 和 ffprobe 二进制文件。

关于python - 有没有以下问题的解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61868362/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com