【问题标题】:is there any solution of the below problem有没有以下问题的解决方案
【发布时间】:2020-09-04 04:17:34
【问题描述】:

这是代码,我得到以下问题文件名是“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

【问题讨论】:

    标签: python python-3.x ffmpeg avconv pydub


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-16
      相关资源
      最近更新 更多