Skip to content

Commit

Permalink
notes to self; borked wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vipyne committed Dec 8, 2024
1 parent fcc4f82 commit f35f047
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/pipecat/services/riva.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def __init__(
)
riva.client.add_custom_configuration_to_config(config, custom_configuration)

# this doesn't work, but something like this perhaps? part 1
self.audio = []
self.responses = self.asr_service.streaming_response_generator(
audio_chunks=[self.audio],
streaming_config=self.config,
)

def can_generate_metrics(self) -> bool:
return False

Expand All @@ -201,12 +208,14 @@ async def cancel(self, frame: CancelFrame):
await super().cancel(frame)

async def run_stt(self, audio: bytes) -> AsyncGenerator[Frame, None]:
responses = self.asr_service.streaming_response_generator(
audio_chunks=[audio],
streaming_config=self.config,
)

for response in responses:
# this doesn't work, but something like this perhaps? part 2
self.audio.append(audio)

# need to start to run this generator only once somewhere...
# 'start' function doesn't work...
# something about the event loop...
# maybe an audio buffer... though my attempt at that didn't work either
for response in self.responses:
if not response.results:
continue
partial_transcript = ""
Expand Down

0 comments on commit f35f047

Please sign in to comment.