Turn any python function into a real-time audio and video stream over WebRTC or WebSockets. Now with the Kroko-ASR TTS Model!
pip install fastrtc-kroko
- Works with FastRTC with added support for the Kroko-ASR TTS model.
- Supports English and French Transcriptions (more will be added as Kroko is updated).
import soundfile as sf
from pathlib import Path
curr_dir = Path(__file__).parent
from fastrtc_kroko import get_stt_model
m = get_stt_model() # You will need to set a HF_TOKEN env variable, or pass it in here.
audio, sr = sf.read(str(curr_dir / "test_file.wav"))
transcript = m.stt((sr, audio))
print(transcript)
Check out the fastrtc documentation for more information.
MIT