diff --git a/sdk/rt/speechmatics/rt/_async_client.py b/sdk/rt/speechmatics/rt/_async_client.py index 892e2549..0aa5864d 100644 --- a/sdk/rt/speechmatics/rt/_async_client.py +++ b/sdk/rt/speechmatics/rt/_async_client.py @@ -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. @@ -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: @@ -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 diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index bc36f39f..2b0bd3fd 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -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