Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions sdk/rt/speechmatics/rt/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ async def force_end_of_utterance(self, timestamp: Optional[float] = None) -> Non
transcript to be sent to the client early.

Takes an optional timestamp parameter to specify a marker for the engine
to use for timing of the end of the utterance. If not provided, the timestamp
will be calculated based on the cumulative audio sent to the server.
to use for timing of the end of the utterance.

Args:
timestamp: Optional timestamp for the request.
Expand All @@ -184,7 +183,6 @@ async def force_end_of_utterance(self, timestamp: Optional[float] = None) -> Non
ConnectionError: If the WebSocket connection fails.
TranscriptionError: If the server reports an error during teardown.
TimeoutError: If the connection or teardown times out.
ValueError: If the audio format does not have an encoding set.

Examples:
Basic streaming:
Expand All @@ -193,9 +191,6 @@ async def force_end_of_utterance(self, timestamp: Optional[float] = None) -> Non
... await client.send_audio(frame)
... await client.force_end_of_utterance()
"""
if timestamp is None:
timestamp = self.audio_seconds_sent

await self.send_message({"message": ClientMessageType.FORCE_END_OF_UTTERANCE, "timestamp": timestamp})

@property
Expand Down
2 changes: 1 addition & 1 deletion sdk/voice/speechmatics/voice/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ async def _await_forced_eou(self, timeout: float = 1.0) -> None:
self._forced_eou_active = True

# Send the force EOU and wait for the response
await self.force_end_of_utterance()
await self.force_end_of_utterance(self.audio_seconds_sent)
await asyncio.wait_for(eou_received.wait(), timeout=timeout)

# Record the latency
Expand Down
Loading