1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-30 19:07:39 +03:00

feat(python tcp server): allow ASR device setting

This commit is contained in:
louistiti 2024-06-17 09:33:48 +08:00
parent de3ceb76be
commit c9afb25ed3
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
{
"asr": {
"rms_threshold": 196
"rms_threshold": 196,
"device": "auto"
},
"tts": {},
"wake_word": {}

View File

@ -66,7 +66,7 @@ class ASR:
self.channels = 1
self.rate = 16000
self.frames_per_buffer = 1024
self.rms_threshold = get_settings('asr')['rms_threshold']
self.rms_threshold = get_settings('asr')['']
# Duration of silence after which the audio data is considered as a new utterance (in seconds)
self.silence_duration = 1
"""

View File

@ -8,6 +8,7 @@ import string
import threading
import lib.nlp as nlp
from .utils import get_settings
from .asr.api import ASR
from .tts.api import TTS
from .constants import (
@ -120,7 +121,7 @@ class TCPServer:
'data': {}
})
self.asr = ASR(device='auto',
self.asr = ASR(device=get_settings('asr')['device'],
interrupt_leon_speech_callback=interrupt_leon_speech_callback,
transcribed_callback=transcribed_callback,
end_of_owner_speech_callback=end_of_owner_speech_callback,