Alina Lozovskaya
commited on
Commit
·
b46d1ae
1
Parent(s):
4525352
Apply Ruff
Browse files
src/reachy_mini_conversation_demo/gstreamer.py
CHANGED
|
@@ -109,7 +109,9 @@ class GstRecorder:
|
|
| 109 |
raise RuntimeError("Failed to create GStreamer elements")
|
| 110 |
|
| 111 |
# Force mono/S16LE at 24000; resample handles device SR (e.g., 16000 → 24000)
|
| 112 |
-
caps = Gst.Caps.from_string(
|
|
|
|
|
|
|
| 113 |
self.appsink.set_property("caps", caps)
|
| 114 |
|
| 115 |
# Build pipeline
|
|
@@ -169,6 +171,7 @@ class GstRecorder:
|
|
| 169 |
self._thread_bus_calls.join()
|
| 170 |
logger.info("Stopped Recorder")
|
| 171 |
|
|
|
|
| 172 |
def _create_device_element(
|
| 173 |
direction: str, name_substr: Optional[str]
|
| 174 |
) -> Optional[Gst.Element]:
|
|
|
|
| 109 |
raise RuntimeError("Failed to create GStreamer elements")
|
| 110 |
|
| 111 |
# Force mono/S16LE at 24000; resample handles device SR (e.g., 16000 → 24000)
|
| 112 |
+
caps = Gst.Caps.from_string(
|
| 113 |
+
f"audio/x-raw,channels=1,rate={sample_rate},format=S16LE"
|
| 114 |
+
)
|
| 115 |
self.appsink.set_property("caps", caps)
|
| 116 |
|
| 117 |
# Build pipeline
|
|
|
|
| 171 |
self._thread_bus_calls.join()
|
| 172 |
logger.info("Stopped Recorder")
|
| 173 |
|
| 174 |
+
|
| 175 |
def _create_device_element(
|
| 176 |
direction: str, name_substr: Optional[str]
|
| 177 |
) -> Optional[Gst.Element]:
|