mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-03 14:48:19 +03:00
feat(python tcp server): allow ASR device
setting
This commit is contained in:
parent
de3ceb76be
commit
c9afb25ed3
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"asr": {
|
"asr": {
|
||||||
"rms_threshold": 196
|
"rms_threshold": 196,
|
||||||
|
"device": "auto"
|
||||||
},
|
},
|
||||||
"tts": {},
|
"tts": {},
|
||||||
"wake_word": {}
|
"wake_word": {}
|
||||||
|
@ -66,7 +66,7 @@ class ASR:
|
|||||||
self.channels = 1
|
self.channels = 1
|
||||||
self.rate = 16000
|
self.rate = 16000
|
||||||
self.frames_per_buffer = 1024
|
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)
|
# Duration of silence after which the audio data is considered as a new utterance (in seconds)
|
||||||
self.silence_duration = 1
|
self.silence_duration = 1
|
||||||
"""
|
"""
|
||||||
|
@ -8,6 +8,7 @@ import string
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
import lib.nlp as nlp
|
import lib.nlp as nlp
|
||||||
|
from .utils import get_settings
|
||||||
from .asr.api import ASR
|
from .asr.api import ASR
|
||||||
from .tts.api import TTS
|
from .tts.api import TTS
|
||||||
from .constants import (
|
from .constants import (
|
||||||
@ -120,7 +121,7 @@ class TCPServer:
|
|||||||
'data': {}
|
'data': {}
|
||||||
})
|
})
|
||||||
|
|
||||||
self.asr = ASR(device='auto',
|
self.asr = ASR(device=get_settings('asr')['device'],
|
||||||
interrupt_leon_speech_callback=interrupt_leon_speech_callback,
|
interrupt_leon_speech_callback=interrupt_leon_speech_callback,
|
||||||
transcribed_callback=transcribed_callback,
|
transcribed_callback=transcribed_callback,
|
||||||
end_of_owner_speech_callback=end_of_owner_speech_callback,
|
end_of_owner_speech_callback=end_of_owner_speech_callback,
|
||||||
|
Loading…
Reference in New Issue
Block a user