sosoxa's picture
Update app.py
69a317e verified
raw
history blame
411 Bytes
from speechbrain.pretrained import EncoderASR
import soundfile as sf
# Load the pretrained ASR model
asr_model = EncoderASR.from_hparams(source="aioxlabs/dvoice-darija", savedir="pretrained_models/asr-wav2vec2-dvoice-dar")
# Load the audio file
audio_input, _ = sf.read("kanbghik.mp3")
# Transcribe the audio
transcription = asr_model.transcribe_file("kanbghik.mp3")
print("Transcription:", transcription)