This topic introduces key concepts in Intelligent Speech Interaction to help explain how the service works.
Sample rate
The audio sample rate is the number of times a recording device samples a sound signal per second. Higher sample rates reproduce sound more faithfully and naturally.
Speech recognition supports sample rates of 16,000 Hz and 8,000 Hz. Telephone audio typically uses 8,000 Hz, whereas other audio typically uses 16,000 Hz.
If the audio sample rate exceeds 16,000 Hz, convert it to 16,000 Hz before sending the audio to the speech recognition service. Do not convert 8,000 Hz audio to 16,000 Hz. Instead, select a model that supports an 8,000 Hz sample rate for the project.
Sample size
The sample size, also called the bit depth, is the number of bits used to quantize the amplitude of each audio sample. A larger sample size provides higher resolution.
Speech recognition commonly uses 16-bit little-endian samples. Each sample occupies 2 bytes and represents 1/16,000 of a second for 16,000 Hz audio. A 2-byte sample size meets the bit-depth requirement for CD-quality audio.
Each sample records an amplitude value. The sample size determines the precision:
1 byte (8 bits) represents 256 amplitude levels.
2 bytes (16 bits) represent 65,536 amplitude levels.
Audio encoding
Audio encoding defines how audio data is stored and transmitted. An audio encoding format differs from an audio file format. For example, a WAV file header specifies the audio encoding, and the audio data may use PCM, AMR, or another supported encoding.
Before calling an Intelligent Speech Interaction service, make sure that the service supports the audio encoding.
Sound channels
A sound channel represents an independent audio signal captured at a specific spatial position. The number of channels therefore equals the number of audio sources recorded. Audio is commonly recorded in mono or stereo.
Except for recording file recognition, Intelligent Speech Interaction services support mono audio only. Convert stereo or multichannel audio to mono before sending it to the service.
Inverse text normalization
Inverse text normalization (ITN) converts numbers, currency amounts, dates, and addresses in speech recognition output into standardized, readable forms. The following table provides examples.
Spoken text | Recognition result with ITN |
Twenty percent | 20% |
May eleventh | May 11 |
Please dial one one zero | Please dial 110 |
Appkey
Each project created in the Intelligent Speech Interaction management console has a unique identifier called an Appkey. Include the Appkey in every service call so that the service can load the project configuration.
Different use cases, such as contact-center calls and mobile input methods, require different speech capabilities. Configure each project for its intended use case to achieve the best results.
AccessKey pair
An AccessKey pair authenticates programmatic calls to Alibaba Cloud APIs. Create and view an AccessKey pair on the AccessKey management page.
An AccessKey pair consists of an AccessKey ID and an AccessKey secret. The AccessKey ID identifies the caller, and the AccessKey secret is used to sign request parameters to prevent tampering. The two values must be used together. Treat the AccessKey secret like a password and never disclose it.
Access token
An access token authenticates calls to Intelligent Speech Interaction services and remains valid for a limited period. Generate it with an AccessKey ID and AccessKey secret.
For calls from mobile devices and other clients, generate the token on a server and send it to the client. This prevents the AccessKey pair from being exposed.
Intermediate results
Configure whether speech recognition returns intermediate results:
When set to false, the service returns one complete result after recognizing the entire utterance.
When set to true, the service returns intermediate results while the speaker is talking, followed by a complete final result.
For example, if the final result is "Hello and welcome to Alibaba Cloud," enabling intermediate results may return the following five results while the speaker is talking:
Hello
Hello and
Hello and welcome
Hello and welcome to
Hello and welcome to Alibaba CloudAn intermediate result may be revised in a later response.
The amount of text added between intermediate results varies. Each response does not necessarily add only one character.
task_id
Each speech service request has a unique task_id that the SDK generates automatically. Use the task_id to troubleshoot requests.