Skip to content

Commit

Permalink
google STT - use the baseclass resampler (livekit#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayeshp19 authored Nov 18, 2024
1 parent 6b03b45 commit 4416785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-zoos-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-google": patch
---

google STT - use the baseclass resampler
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ def __init__(
client: SpeechAsyncClient,
recognizer: str,
config: STTOptions,
sample_rate: int = 48000,
sample_rate: int = 16000,
num_channels: int = 1,
max_retry: int = 32,
) -> None:
super().__init__(stt)
super().__init__(stt, sample_rate=sample_rate)

self._client = client
self._recognizer = recognizer
Expand Down Expand Up @@ -294,9 +294,6 @@ async def input_generator():

async for frame in self._input_ch:
if isinstance(frame, rtc.AudioFrame):
frame = frame.remix_and_resample(
self._sample_rate, self._num_channels
)
yield cloud_speech.StreamingRecognizeRequest(
audio=frame.data.tobytes()
)
Expand Down

0 comments on commit 4416785

Please sign in to comment.