File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 29
29
30
30
# Azure Parameters
31
31
AZURE_SPEECH_VOICE = "en-GB-OliverNeural"
32
+ DEVICE_ID = None
32
33
33
34
# Speech Recognition Parameters
34
35
ENERGY_THRESHOLD = 1000 # Energy level for mic to detect
@@ -157,10 +158,14 @@ def __init__(self, azure_speech_config):
157
158
self .do_mouth_movement = False
158
159
self ._mouth_thread = threading .Thread (target = self .move_mouth , daemon = True )
159
160
self ._mouth_thread .start ()
160
-
161
+ if DEVICE_ID is None :
162
+ audio_config = speechsdk .audio .AudioOutputConfig (use_default_speaker = True )
163
+ else :
164
+ audio_config = speechsdk .audio .AudioOutputConfig (device_name = DEVICE_ID )
161
165
self ._speech_synthesizer = speechsdk .SpeechSynthesizer (
162
- speech_config = azure_speech_config
166
+ speech_config = azure_speech_config , audio_config = audio_config
163
167
)
168
+
164
169
self ._speech_synthesizer .synthesizing .connect (self .start_moving_mouth )
165
170
self ._speech_synthesizer .synthesis_completed .connect (self .stop_moving_mouth )
166
171
You can’t perform that action at this time.
0 commit comments