Add realtimesst example

This commit is contained in:
mudler
2025-02-05 19:57:25 +01:00
parent 2a6650c3ea
commit 6ae019db23
3 changed files with 26 additions and 0 deletions

12
Dockerfile.realtimesst Normal file
View File

@@ -0,0 +1,12 @@
# python
FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y python3-dev portaudio19-dev ffmpeg build-essential
RUN pip install RealtimeSTT
#COPY ./example/realtimesst /app
# https://github.com/KoljaB/RealtimeSTT/blob/master/RealtimeSTT_server/README.md#server-usage
ENTRYPOINT ["stt-server"]
#ENTRYPOINT [ "/app/main.py" ]

12
example/realtimesst/main.py Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from RealtimeSTT import AudioToTextRecorder
def process_text(text):
print(text)
if __name__ == '__main__':
recorder = AudioToTextRecorder(wake_words="jarvis")
while True:
recorder.text(process_text)

2
start_realtimesst.sh Normal file
View File

@@ -0,0 +1,2 @@
docker build -t realtimesst -f Dockerfile.realtimesst .
docker run -v $PWD/cache:/root/.cache -p 8012:8012 -p 8011:8011 -ti --rm realtimesst -w "jarvis" -D