Spaces:
Runtime error
Runtime error
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) | |