Skip to content

Commit

Permalink
fix numpy bug (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
yq-xfl committed Jun 20, 2023
1 parent d82251c commit 81579bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-api-examples/streaming_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ async def handle_connection_impl(

await socket.send(json.dumps(message))

tail_padding = np.rand(int(self.sample_rate * 0.3), dtype=np.float32)
stream.accept_waveform(sampling_rate=self.sample_rate, waveform=tail_padding)
tail_padding = np.zeros(int(self.sample_rate * 0.3)).astype(np.float32)
stream.accept_waveform(sample_rate=self.sample_rate, waveform=tail_padding)
stream.input_finished()
while self.recognizer.is_ready(stream):
await self.compute_and_decode(stream)
Expand Down

0 comments on commit 81579bb

Please sign in to comment.