-3

This is code and I'm getting the following issue filename is "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

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Sonu
  • 1
  • 1

1 Answers1

0

The library you are using requires ffmpeg (or avconv). I would suggest ffmepg (but you should check the license restrictions of your project if needed). You could download it from official then make sure the bin folder of the downloaded ffmpeg application is in your path (see https://www.wikihow.com/Install-FFmpeg-on-Windows for example) Then your code above will see both ffmpeg and ffprobe binaries.

JScoobyCed
  • 10,203
  • 6
  • 34
  • 58