Audio processing error: filenotfounderror: [errno 2] no such file or directory: ‘ffmpeg’: ‘ffmpeg’
An error occurs when the following code is executed
import audiosegment
print("Reading in the wave file...")
seg = audiosegment.from_file("voice_data/out_11.wav")
print("Information:")
print("Channels:", seg.channels)
print("Bits per sample:", seg.sample_width * 8)
print("Sampling frequency:", seg.frame_rate)
print("Length:", seg.duration_seconds, "seconds")
print("Detecting voice...")
seg = seg.resample(sample_rate_Hz=32000, sample_width=2, channels=1)
results = seg.detect_voice()
voiced = [tup[1] for tup in results if tup[0] == 'v']
unvoiced = [tup[1] for tup in results if tup[0] == 'u']
print("Reducing voiced segments to a single wav file 'voiced.wav'")
voiced_segment = voiced[0].reduce(voiced[1:])
voiced_segment.export("voiced.wav", format="WAV")
print("Reducing unvoiced segments to a single wav file 'unvoiced.wav'")
unvoiced_segment = unvoiced[0].reduce(unvoiced[1:])
unvoiced_segment.export("unvoiced.wav", format="WAV")
Error content
Solution:
use the command: brew install ffmpeg installation. If the following problems occur, let’s continue brew install ffmpeg installation without turning off the error message.
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:c16266957db69346464e39967d41d5198f3550423d6
############################ 40.0%
curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
Error: ffmpeg: Failed to download resource "rav1e"
Download failed: https://ghcr.io/v2/homebrew/core/rav1e/blobs/sha256:c16266957db69346464e39967d41d5198f3550423d6aabfb62919975cf52ea19
After that, new error messages are found as follows:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
brew link --overwrite [email protected]
To list all files that would be deleted:
brew link --overwrite --dry-run [email protected]
Follow the prompts and execute the following statements:
rm '/usr/local/bin/2to3'
brew link --overwrite [email protected]
brew link --overwrite --dry-run [email protected]
Read More:
- Python FileNotFoundError: [Errno 2] No such file or directory: ‘objects/epsilon.pkl
- [Solved] Python project runs the open() function error: FileNotFoundError: [Errno 2] No such file or directory
- PIP Install Mysqlclient error C1083: Cannot open include file: ‘mysql.h‘: No such file or directory
- ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
- [Solved] Import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- OSError libespeak.so.1 error: no such file or directory [How to Solve]
- Python environment error, bad interpreter: there is no file or directory
- fatal error: cublas_v2.h: No such file or directory [How to Solve]
- The solution of no such file or directory and cannot load native module running error of python3 pyinstaller after packaging
- [Solved] ROS fatal error: NvInferRuntimeCommon. h: No such file or directory
- Raspberry pie compilation and installation opencv error: fatal error: bootdesc_bgm.i: No such file or directory
- cffi Security Report “c / _cffi_backend.oc / _cffi_backend.c: 15:17: error: ffi.h: No such file or directory” Problem
- Tensorflow import Error: ImportError: libcuda.so.1: cannot open shared object file: No such file or dire
- Ctypes DLL Error: FileNotFoundError: Could not find module ‘***_dll.dll‘ (or one of its dependencies).
- MAC OS install python3 Error: Permission denied @ dir_s_mkdir-/usr/local/Frameworks
- Python: How to Solve mysqlclient Install Error in Mac
- FileNotFoundError: Could not find module ‘D:\Anaconda3\envs\labe\Library\bin\geos_c.dll‘ [Solved]
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- Python: How to Delete Empty Files or Folders in the Directory
- Mac install python_Levenshtein Error: error: command ‘clang‘ failed with exit status 1