Speech input
Introduction
Use the speech input component to capture audio from users.

Configuration items
Category |
Configuration |
Example |
Description |
Content |
Text |
The text that the component displays in the stop state. This can be left empty. |
|
Status |
The state of the component. Valid values are stop, recording, and processing. If this is empty, the component controls its own state.
|
||
Interaction mode |
The method for starting a recording. If you select "External control", the component is hidden. Recording can only be started and stopped using the component API. |
||
Speech upload |
If enabled, the component automatically uploads the audio file in WebM format to the selected storage path. The URL of the audio file is then saved to the remoteURL property of the component. |
||
Speech storage path |
This is required when Speech upload is enabled. Specify the storage path for the audio file. |
||
Extension configuration |
The prefix and suffix icons for the component. To display only an icon, leave the text empty and set the prefix or suffix icon. |
||
Interaction |
Hidden |
Hides the component. For more information, see Common properties. |
|
Style |
Height |
The height of the component. For more information, see Common properties. |
|
Margin |
The margin of the component. For more information, see Common properties. |
||
CSS style |
Border radius |
The border radius of the component. |
|
Font size |
The size of the component's text and icon. |
||
Background color |
The background color of the component. |
||
Text color |
The color of the component's text and icon. |
||
Active background color |
The background color of the component in its active state. |
||
Active text color |
The color of the component's text and icon in its active state. |
||
Hover background color |
The background color of the component in its hover state. |
||
Hover text color |
The color of the component's text and icon in its hover state. |
Properties
Name |
Type |
Example |
Description |
audioFile |
File/MobiFile |
|
If speech upload is disabled, audioFile is a File object that contains the speech input result. If speech upload is enabled, audioFile is a MobiFile object. |
audioURL |
string |
|
The base64 URL of the speech input result. |
remoteURL |
string |
|
This property has a value only when speech upload is enabled. The value is the URL of the uploaded audio file. |
status |
string |
|
The internal state of the component.
|
uploadMode |
string |
|
The upload mode. Valid values are 'none' and 'system'. |
hidden |
boolean |
|
Indicates whether the component is hidden. |
Event callbacks
Configuration |
Description |
An event that triggers before a recording is requested. If this event is set to execute a script and the script returns |
|
An event that triggers after recording starts. |
|
An event that triggers when recording fails to start. For example, this occurs if the user has not granted access to the microphone. |
|
An event that triggers after recording stops. |
|
An event that triggers after a successful upload. This is effective only when Speech upload is set to "Upload to system file storage". |
|
An event that triggers after a failed upload. This is effective only when Speech upload is set to "Upload to system file storage". |
The events are executed in the following order:
Before requesting to record
Recording started / Recording start failed
Recording stopped
Upload successful / Upload failed