-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
.....\lib\site-packages\autosub_init_.py", line 185, in extract_audio
raise Exception("Dependency not found: ffmpeg")
chang the init.py
import shutil
def extract_audio(filename, channels=1, rate=16000):
"""
Extract audio from an input file to a temporary WAV file.
"""
temp = tempfile.NamedTemporaryFile(suffix='.wav', delete=False)
if not os.path.isfile(filename):
print(f"The given file does not exist: {filename}")
raise Exception(f"Invalid filepath: {filename}")
# Use shutil.which to find ffmpeg (cross-platform compatible)
ffmpeg_path = shutil.which("ffmpeg")
if not ffmpeg_path:
print("ffmpeg: Executable not found on machine.")
raise Exception("Dependency not found: ffmpeg")
# Use the full path to ffmpeg in the command
command = [ffmpeg_path, "-y", "-i", filename,
"-ac", str(channels), "-ar", str(rate),
"-loglevel", "error", temp.name]
# On Windows, shell=True is needed
use_shell = os.name == "nt"
subprocess.check_output(command, stdin=open(os.devnull), shell=use_shell)
return temp.name, rateMetadata
Metadata
Assignees
Labels
No labels