Zack Saadioui
8/27/2024
1
2
bash
curl https://ollama.ai/install.sh | sh
1
2
bash
ollama pull whisper
1
assistant.yaml
1
2
``
In this example, replace
1
PyAudio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# Audio configuration CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 16000 stream = pyaudio.PyAudio().open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, frames_per_buffer=CHUNK) print('Listening...') while True: data = stream.read(CHUNK) audio = np.frombuffer(data, dtype="int16") # Transcribe the audio chunk result = model.transcribe(audio) print(result["text"]) # Output the transcription
Copyright © Arsturn 2025