self._muted now returns from STT process_audio_frames
This commit is contained in:
@@ -525,9 +525,13 @@ class STTService(AIService):
|
|||||||
else:
|
else:
|
||||||
logger.warning(f"Unknown setting for STT service: {key}")
|
logger.warning(f"Unknown setting for STT service: {key}")
|
||||||
|
|
||||||
async def process_audio_frame(self, frame: AudioRawFrame):
|
async def process_audio_frame(self, frame: AudioRawFrame, direction: FrameDirection):
|
||||||
if not self._muted:
|
if self._muted:
|
||||||
await self.process_generator(self.run_stt(frame.audio))
|
return
|
||||||
|
|
||||||
|
await self.process_generator(self.run_stt(frame.audio))
|
||||||
|
if self._audio_passthrough:
|
||||||
|
await self.push_frame(frame, direction)
|
||||||
|
|
||||||
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
||||||
"""Processes a frame of audio data, either buffering or transcribing it."""
|
"""Processes a frame of audio data, either buffering or transcribing it."""
|
||||||
@@ -537,9 +541,7 @@ class STTService(AIService):
|
|||||||
# In this service we accumulate audio internally and at the end we
|
# In this service we accumulate audio internally and at the end we
|
||||||
# push a TextFrame. We also push audio downstream in case someone
|
# push a TextFrame. We also push audio downstream in case someone
|
||||||
# else needs it.
|
# else needs it.
|
||||||
await self.process_audio_frame(frame)
|
await self.process_audio_frame(frame, direction)
|
||||||
if self._audio_passthrough:
|
|
||||||
await self.push_frame(frame, direction)
|
|
||||||
elif isinstance(frame, STTUpdateSettingsFrame):
|
elif isinstance(frame, STTUpdateSettingsFrame):
|
||||||
await self._update_settings(frame.settings)
|
await self._update_settings(frame.settings)
|
||||||
elif isinstance(frame, STTMuteFrame):
|
elif isinstance(frame, STTMuteFrame):
|
||||||
|
|||||||
Reference in New Issue
Block a user