Add realtimesst example
This commit is contained in:
12
Dockerfile.realtimesst
Normal file
12
Dockerfile.realtimesst
Normal 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
12
example/realtimesst/main.py
Executable 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
2
start_realtimesst.sh
Normal 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
|
||||||
Reference in New Issue
Block a user