From 68777d14d5c9775381f77c7391c579df5e005987 Mon Sep 17 00:00:00 2001 From: James Walker Date: Wed, 13 Aug 2025 10:15:25 +0100 Subject: [PATCH 1/2] modify get channel to properly take moved channels into account --- speechmatics/cli.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/speechmatics/cli.py b/speechmatics/cli.py index bbdaac4..bcb7f96 100755 --- a/speechmatics/cli.py +++ b/speechmatics/cli.py @@ -590,10 +590,7 @@ def transcript_handler(message): transcripts.text += plaintext def get_channel(message): - return next( - (result["channel"] for result in message["results"] if "channel" in result), - None, - ) + return message.get("channel", None) def audio_event_handler(message): if print_json: From be68bd6d198afc410105d29821e80a2c7a7a2b9a Mon Sep 17 00:00:00 2001 From: J-Jaywalker <103967935+J-Jaywalker@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:48:03 +0100 Subject: [PATCH 2/2] Change get to return default value Co-authored-by: Dumitru Gutu --- speechmatics/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speechmatics/cli.py b/speechmatics/cli.py index bcb7f96..ad7e62a 100755 --- a/speechmatics/cli.py +++ b/speechmatics/cli.py @@ -590,7 +590,7 @@ def transcript_handler(message): transcripts.text += plaintext def get_channel(message): - return message.get("channel", None) + return message.get("channel") def audio_event_handler(message): if print_json: