Spaces:
Running
Running
CarolinePascal commited on
chore(ruff)
Browse files
src/reachy_mini_conversation_app/console.py
CHANGED
|
@@ -8,7 +8,7 @@ import asyncio
|
|
| 8 |
import logging
|
| 9 |
from typing import List
|
| 10 |
|
| 11 |
-
from fastrtc import AdditionalOutputs,
|
| 12 |
from scipy.signal import resample
|
| 13 |
|
| 14 |
from reachy_mini import ReachyMini
|
|
|
|
| 8 |
import logging
|
| 9 |
from typing import List
|
| 10 |
|
| 11 |
+
from fastrtc import AdditionalOutputs, audio_to_float32
|
| 12 |
from scipy.signal import resample
|
| 13 |
|
| 14 |
from reachy_mini import ReachyMini
|
src/reachy_mini_conversation_app/openai_realtime.py
CHANGED
|
@@ -3,7 +3,7 @@ import base64
|
|
| 3 |
import random
|
| 4 |
import asyncio
|
| 5 |
import logging
|
| 6 |
-
from typing import Any, Tuple, Literal
|
| 7 |
from datetime import datetime
|
| 8 |
|
| 9 |
import numpy as np
|
|
@@ -291,12 +291,12 @@ class OpenaiRealtimeHandler(AsyncStreamHandler):
|
|
| 291 |
|
| 292 |
Args:
|
| 293 |
frame: A tuple containing the sample rate and the audio frame.
|
|
|
|
| 294 |
"""
|
| 295 |
-
|
| 296 |
if not self.connection:
|
| 297 |
return
|
| 298 |
input_sample_rate, audio_frame = frame
|
| 299 |
-
|
| 300 |
# Reshape if needed
|
| 301 |
if audio_frame.ndim == 2:
|
| 302 |
audio_frame = audio_frame.squeeze()
|
|
|
|
| 3 |
import random
|
| 4 |
import asyncio
|
| 5 |
import logging
|
| 6 |
+
from typing import Any, Tuple, Literal
|
| 7 |
from datetime import datetime
|
| 8 |
|
| 9 |
import numpy as np
|
|
|
|
| 291 |
|
| 292 |
Args:
|
| 293 |
frame: A tuple containing the sample rate and the audio frame.
|
| 294 |
+
|
| 295 |
"""
|
|
|
|
| 296 |
if not self.connection:
|
| 297 |
return
|
| 298 |
input_sample_rate, audio_frame = frame
|
| 299 |
+
|
| 300 |
# Reshape if needed
|
| 301 |
if audio_frame.ndim == 2:
|
| 302 |
audio_frame = audio_frame.squeeze()
|