Fixing the audio duration should be less than 30s error
Written by
Updated at December 17, 2025
Issue description
When uploading an OGG audio file to the SpeechKit API for recognition, you get this error:
{'error_code': 'BAD_REQUEST', 'error_message': 'audio duration should be less than 30s'}
This happens even if the uploaded audio file is shorter than 30 seconds.
Solution
The cause of the error is that the codec of the file uploaded for recognition is not supported. For OGG files, SpeechKit only supports the Opus codec.
For proper recognition, you need to upload data encoded by this codec.