scooter7 commited on
Commit
e3a5afc
·
verified ·
1 Parent(s): 9345437

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -153,6 +153,14 @@ class RAGVoiceHandler(AsyncStreamHandler):
153
  self.input_buffer = bytearray()
154
  self.last_input_time = asyncio.get_event_loop().time()
155
 
 
 
 
 
 
 
 
 
156
  async def stream(self) -> AsyncGenerator[bytes, None]:
157
  # Continuously check for new audio; if a short silence occurs (timeout), process the buffered utterance.
158
  while not self.quit.is_set():
 
153
  self.input_buffer = bytearray()
154
  self.last_input_time = asyncio.get_event_loop().time()
155
 
156
+ def copy(self) -> "RAGVoiceHandler":
157
+ # Return a new instance with the same configuration
158
+ return RAGVoiceHandler(
159
+ expected_layout="mono",
160
+ output_sample_rate=self.output_sample_rate,
161
+ output_frame_size=self.output_frame_size,
162
+ )
163
+
164
  async def stream(self) -> AsyncGenerator[bytes, None]:
165
  # Continuously check for new audio; if a short silence occurs (timeout), process the buffered utterance.
166
  while not self.quit.is_set():