# Can't read in audio files for transcription

**URL:** <https://discuss.huggingface.co/t/cant-read-in-audio-files-for-transcription/93223>\
**Category:** Beginners\
**Created:** [June 20, 2024, 4:34pm UTC](https://discuss.huggingface.co/t/cant-read-in-audio-files-for-transcription/93223 "2024-06-20T16:34:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tylersbarlow](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@tylersbarlow](https://discuss.huggingface.co/u/tylersbarlow)\
**Post date:** [June 20, 2024, 4:34pm UTC](https://discuss.huggingface.co/t/cant-read-in-audio-files-for-transcription/93223/1 "2024-06-20T16:34:19Z")

</div>

Hello, I am trying to import my own personal audio file to pass through a whisper pipeline and output the transcription. My code looks like this so far:

import torch  
import gradio as gr  
import soundfile as sf  
from IPython.display import Audio  
from transformers import pipeline  
import numpy  
import ffmpeg

device = “cuda:0” if torch.cuda.is\_available() else “cpu”  
pipe = pipeline(  
“automatic-speech-recognition”, model=“openai/whisper-large-v3”, device=device  
)

def transcribe\_speech(filepath):  
output = pipe(  
filepath,  
max\_new\_tokens=256,  
generate\_kwargs={  
“task”: “transcribe”,  
},  
chunk\_length\_s=30,  
batch\_size=8,  
)  
return output[“text”]

transcribe\_speech(“example2.mp3”)

Most of this was copied directly from the HF Audio course, but even though I’ve done  
pip install ffmpeg  
import ffmpeg

Whenever I try and run the code I get “ValueError: ffmpeg was not found but is required to load audio files from filename”

---

<div class="post-metadata">

**Author:** ![tylersbarlow](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@tylersbarlow](https://discuss.huggingface.co/u/tylersbarlow)\
**Post date:** [June 20, 2024, 4:35pm UTC](https://discuss.huggingface.co/t/cant-read-in-audio-files-for-transcription/93223/2 "2024-06-20T16:35:00Z")

</div>

I’ve tried online fixes such as downloading FFMPEG directly and placing the .exe file into my PATH, but nothing seems to be working

---

<div class="post-metadata">

**Author:** ![Svetlana0303](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Svetlana0303](https://discuss.huggingface.co/u/Svetlana0303)\
**Post date:** [June 29, 2024, 7:39am UTC](https://discuss.huggingface.co/t/cant-read-in-audio-files-for-transcription/93223/3 "2024-06-29T07:39:28Z")

</div>

I have the same issue!! Please, help
