How to recognize short audio files in SpeechKit
Written by
Updated at October 24, 2024
The service can recognize speech in different ways. In the example below, the audio file is recognized 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 \
--request POST \
--header "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 you got before you started.IAM_TOKEN
: IAM token you got before you started.lang
: Recognition language.speech.ogg
: Speech audio file.
The service responds with the recognized text:
{
"result":"I'm Yandex SpeechKit. I can turn any text into speech. Now you can, too!"
}