SegmentedSTTService: ignore emulated frames
This commit is contained in:
@@ -1048,9 +1048,14 @@ class SegmentedSTTService(STTService):
|
||||
await self._handle_user_stopped_speaking(frame)
|
||||
|
||||
async def _handle_user_started_speaking(self, frame: UserStartedSpeakingFrame):
|
||||
if frame.emulated:
|
||||
return
|
||||
self._user_speaking = True
|
||||
|
||||
async def _handle_user_stopped_speaking(self, frame: UserStoppedSpeakingFrame):
|
||||
if frame.emulated:
|
||||
return
|
||||
|
||||
self._user_speaking = False
|
||||
|
||||
content = io.BytesIO()
|
||||
@@ -1068,7 +1073,7 @@ class SegmentedSTTService(STTService):
|
||||
self._audio_buffer.clear()
|
||||
|
||||
async def process_audio_frame(self, frame: AudioRawFrame, direction: FrameDirection):
|
||||
# If the user is speaking the audio buffer will keep growin.
|
||||
# If the user is speaking the audio buffer will keep growing.
|
||||
self._audio_buffer += frame.audio
|
||||
|
||||
# If the user is not speaking we keep just a little bit of audio.
|
||||
|
||||
Reference in New Issue
Block a user