FileNotFoundError: [Errno 2] No such file or directory: ‘ffprobe‘: ‘ffprobe‘

在处理音频文件的时候,对数据预处理时的报错:

Traceback (most recent call last):
  File "create_wenetspeech_data.py", line 80, in 
    process_wenetspeech(wenetspeech_json=args.wenetspeech_json, annotation_dir=args.annotation_dir)
  File "create_wenetspeech_data.py", line 50, in process_wenetspeech
    source_wav = AudioSegment.from_file(long_audio_path)
  File "************/python3.7/site-packages/pydub/audio_segment.py", line 728, in from_file
    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
  File "************/python3.7/site-packages/pydub/utils.py", line 274, in mediainfo_json
    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
  File "************/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "************/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'

我先是按照网上的方法先后进行 pip install ffprobe、pip install ffmpeg 后仍报错,最后在这个博主的博文找到了解决办法https://blog.csdn.net/roxxo/article/details/108663833

先:sudo apt-get update ,然后再sudo apt-get install ffmpeg,问题就解决了。【我的要加sudo,否则权限不够】

你可能感兴趣的:(语音识别)