Spaces:
Runtime error
Runtime error
File size: 411 Bytes
69a317e 137940e 69a317e ab92104 69a317e ab92104 69a317e ab92104 69a317e f7889cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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)
|