Record a FLAC (or any FFmpeg supported audio file, other .WAV or RAW), naming it "NewTest.{insert_audio_ext}"
Enter the following code into a new Python script (Save that script within the same folder as the audio):
from pydub import AudioSegment as AS
from pydub.playback import play
# The path of ffmpeg installation for Homebrew may vary from person-to-person
AS.converter = "/usr/local/Cellar/ffmpeg/4.3.2_3/bin/ffmpeg"
AS.ffprobe = "/usr/local/Cellar/ffmpeg/4.3.2_3/bin/ffprobe"
audio = AS.from_file("NewTest.flac")
audio.export("FinalTest.mp3", format="mp3")
play(audio)
Expected behaviour
An mp3 file named "FinalTest.mp3" should be exported, without causing any error.
Actual behaviour
An error traced back to line : audio = AS.from_file("NewTest.flac")
Stating: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'
Note:
Only "ffprobe" does not connect properly. After stating absolute file path using AS.converter, "ffmpeg" works correctly.
I'm hoping to rely on ffmpeg, and not use libav. Most Documentation feature ffmpeg more than libav.
Tried removing & changing file path of AS.ffprobe, but results the same error.
Tried manually copying the "ffmpeg", "ffprobe" & "ffplay" UNIX exec files to the same location as the Python Script. That also didn't work, even after adjusting the file paths accordingly (that actually made it worse).
Steps to reproduce
Enter the following code into a new Python script (Save that script within the same folder as the audio):
Expected behaviour
An mp3 file named "FinalTest.mp3" should be exported, without causing any error.
Actual behaviour
An error traced back to line :
audio = AS.from_file("NewTest.flac")
Stating: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'Note:
Your System configuration