awslabs / amazon-transcribe-streaming-sdk

The Amazon Transcribe Streaming SDK is an async Python SDK for converting audio into text via Amazon Transcribe.
Apache License 2.0
151 stars 38 forks source link

Possible bug in input validation for start_stream_transcription #88

Open sm-andrew-w opened 1 year ago

sm-andrew-w commented 1 year ago

When calling start_stream_transcription(), if I pass in a value of 1 for number_of_channels, I get this error message:

  stream = await client.start_stream_transcription(
File "[...]\.awst_env\lib\site-packages\amazon_transcribe\client.py", line 187, in start_stream_transcription
    raise self._response_parser.parse_exception(resolved_response, body_bytes)
amazon_transcribe.exceptions.BadRequestException: 1 validation error detected: Value '1' at 'numberOfChannels' failed to satisfy constraint: Member must have value greater than or equal to 2

But if I don't pass any value, the transcription appears to work correctly with my 1-channel audio. The docs say 1-channel is supported, and the quick-start example uses 1-channel. So I'm assuming 1-channel is valid input, and maybe this is an issue with the validation logic? I can work around it by passing None if my channel count is 1, but this seems like an unnecessary hassle.

This is on Windows with Python 3.9.