diff --git a/CHANGELOG.md b/CHANGELOG.md index e80c493..93be58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.14.5] - 2024-03-20 + +## Added + +- Support for audio_events in Batch CLI. +- Support `types` whitelist for audio events. + ## [1.14.4] - 2024-03-04 ## Added diff --git a/VERSION b/VERSION index 4e00d0a..24a57f2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.14.4 +1.14.5 diff --git a/speechmatics/cli.py b/speechmatics/cli.py index 72ba91a..08c092d 100755 --- a/speechmatics/cli.py +++ b/speechmatics/cli.py @@ -350,10 +350,12 @@ def get_transcription_config( audio_events_config = config.get("audio_events_config", None) arg_audio_events = args.get("audio_events", False) if audio_events_config is not None or arg_audio_events: - types = None + event_types = None if audio_events_config and audio_events_config.get("types"): - types = audio_events_config.get("types") - config["audio_events_config"] = AudioEventsConfig(types) + event_types = audio_events_config.get("types") + if args.get("event_types"): + event_types = str(args.get("event_types")).split(",") + config["audio_events_config"] = AudioEventsConfig(event_types) if args["mode"] == "rt": # pylint: disable=unexpected-keyword-arg diff --git a/speechmatics/cli_parser.py b/speechmatics/cli_parser.py index 5ac2d23..3087b88 100644 --- a/speechmatics/cli_parser.py +++ b/speechmatics/cli_parser.py @@ -479,6 +479,29 @@ def get_arg_parser(): action="store_true", help="Enable audio event detection and print events in square-brackets to the console, e.g. [MUSIC]", ) + rt_transcribe_command_parser.add_argument( + "--event-types", + default=None, + type=str, + required=False, + help="Comma-separated list of whitelisted event types for audio events.", + ) + + # Parent parser for batch auto-chapters argument + batch_audio_events_parser = argparse.ArgumentParser(add_help=False) + batch_audio_events_parser.add_argument( + "--audio-events", + action="store_true", + help="Enable audio event detection, " + "will include `audio_events` and `audio_event_summary` keys in output (JSON only)", + ) + batch_audio_events_parser.add_argument( + "--event-types", + default=None, + type=str, + required=False, + help="Comma-separated list of whitelisted event types for audio events.", + ) # Build our actual parsers. mode_subparsers = parser.add_subparsers(title="Mode", dest="mode") @@ -514,6 +537,7 @@ def get_arg_parser(): batch_sentiment_analysis_parser, batch_topic_detection_parser, batch_auto_chapters_parser, + batch_audio_events_parser, ], help="Transcribe one or more audio files using batch mode, while waiting for results.", )