Error: ffmpeg was not found but is required to load audio files from filename

#113
by Vladmir1235432 - opened

If you're experiencing this problem too, try the following:

  1. Add the library to your project "import soundfile as sf"

  2. Replace the next part of code
    delete --> result = pipe("your_file.wav") # This interaction is described in the README.md file on the model page

    -------Insert-------------------------------------------------
    data, samplerate = sf.read('your_file.wav') # Extracting the information and sample rate of the audio from the audio file
    result = pipe(data) # Ignore the information necessary for audio playback and work only with sound. Now the system treats the "data" variable not as an audio file, but as an array of data. Therefore, we no longer need the ffmpeg library

What about in cases if you're working with audio with multiple channels? using this throws up an error of "ValueError: We expect a single channel audio input for AutomaticSpeechRecognitionPipeline"

Convert multichannel audio to mono before sending it to whisper for recognition. Sum all the audio channels into one. Whisper can only work with 1 channel audio

Fantastic! Thankyou, this helped a lot :)

Sign up or log in to comment