How to recognize short audio files in SpeechKit
Written by
Updated at December 26, 2023
The service can recognize speech in different ways. The example below demonstrates an audio file recognition using the synchronous recognition API. This API has the following limitations:
- Maximum audio duration: 30 seconds
- Maximum file size: 1 MB
Send a speech recognition request:
export FOLDER_ID=<folder_ID>
export IAM_TOKEN=<IAM_token>
curl -X POST \
-H "Authorization: Bearer ${IAM_TOKEN}" \
--data-binary "@speech.ogg" \
"https://stt.api.cloud.yandex.net/speech/v1/stt:recognize?folderId=${FOLDER_ID}&lang=ru-RU"
Where:
FOLDER_ID
: Folder ID received before startingIAM_TOKEN
: IAM token received before startinglang
: Recognition languagespeech.ogg
: Audio file with speech
The service responds with the recognized text:
{
"result":"I'm Yandex SpeechKit. I can turn any text into speech. Now you can, too!"
}