Spaces:
Running
Running
apirrone commited on
Commit ·
6a3b82f
1
Parent(s): 133b098
trying to use the fastrtc ui. buggy for now
Browse files
src/reachy_mini_conversation_demo/main.py
CHANGED
|
@@ -285,7 +285,7 @@ async def loop():
|
|
| 285 |
tasks = [
|
| 286 |
# asyncio.create_task(openai.start_up(), name="openai"),
|
| 287 |
# asyncio.create_task(emit_loop(player, openai, stop_event), name="emit"),
|
| 288 |
-
asyncio.create_task(receive_loop(recorder, openai, stop_event), name="recv"),
|
| 289 |
# asyncio.create_task(
|
| 290 |
# control_mic_loop(stop_event, robot_is_speaking, speaking_queue, audio_sync),
|
| 291 |
# name="mic-mute",
|
|
|
|
| 285 |
tasks = [
|
| 286 |
# asyncio.create_task(openai.start_up(), name="openai"),
|
| 287 |
# asyncio.create_task(emit_loop(player, openai, stop_event), name="emit"),
|
| 288 |
+
# asyncio.create_task(receive_loop(recorder, openai, stop_event), name="recv"),
|
| 289 |
# asyncio.create_task(
|
| 290 |
# control_mic_loop(stop_event, robot_is_speaking, speaking_queue, audio_sync),
|
| 291 |
# name="mic-mute",
|
src/reachy_mini_conversation_demo/openai_realtime.py
CHANGED
|
@@ -104,9 +104,9 @@ class OpenAIRealtimeHandler(AsyncStreamHandler):
|
|
| 104 |
"turn_detection": {
|
| 105 |
"type": "server_vad",
|
| 106 |
# Commenting the next three lines makes the interaction much more reactive
|
| 107 |
-
"threshold": 0.6,
|
| 108 |
-
"prefix_padding_ms": 300,
|
| 109 |
-
"silence_duration_ms": 800,
|
| 110 |
},
|
| 111 |
"voice": "ballad",
|
| 112 |
"instructions": SESSION_INSTRUCTIONS,
|
|
@@ -187,7 +187,7 @@ class OpenAIRealtimeHandler(AsyncStreamHandler):
|
|
| 187 |
if et == "response.audio.delta":
|
| 188 |
self.robot_is_speaking.set()
|
| 189 |
# block mic briefly per chunk to reduce echo
|
| 190 |
-
self.speaking_queue.put_nowait(0.25)
|
| 191 |
self.audio_sync.on_response_audio_delta(
|
| 192 |
getattr(event, "delta", b"")
|
| 193 |
)
|
|
|
|
| 104 |
"turn_detection": {
|
| 105 |
"type": "server_vad",
|
| 106 |
# Commenting the next three lines makes the interaction much more reactive
|
| 107 |
+
# "threshold": 0.6,
|
| 108 |
+
# "prefix_padding_ms": 300,
|
| 109 |
+
# "silence_duration_ms": 800,
|
| 110 |
},
|
| 111 |
"voice": "ballad",
|
| 112 |
"instructions": SESSION_INSTRUCTIONS,
|
|
|
|
| 187 |
if et == "response.audio.delta":
|
| 188 |
self.robot_is_speaking.set()
|
| 189 |
# block mic briefly per chunk to reduce echo
|
| 190 |
+
# self.speaking_queue.put_nowait(0.25)
|
| 191 |
self.audio_sync.on_response_audio_delta(
|
| 192 |
getattr(event, "delta", b"")
|
| 193 |
)
|