domain
The universe in which the Streaming STT API is used for transcribing the speech. Refer to Supporting Domain to see the available domains.
For Example :
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
domain : 'generic' ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
timeout
The duration to keep a connection open between the application and the STT server. Note: The default timeout = 15 seconds, and the maximum time allowed = 180 seconds.
For Example :
timeout = 15
timeout = 180
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
domain : 'generic' ,
timeout : 15 ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
silence
The time to determine when to end the connection automatically after detecting the silence after receiving the speech data. For Example: Consider silence
= 15 seconds i.e., On passing the speech for 60 seconds, and if you remain silent, the connection will be open for the next 15 seconds and then will automatically get disconnected. Note: The default silence
= 1 second, and the maximum silence
= 30 seconds.
For Example :
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
domain : 'generic' ,
silence : 1 ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
The audio sampling rate and the data format of the speech. Refer to Supporting Audio Formats to know the supporting audio formats. By default, the format
= 16k_int16. (WAV, Signed 16 bit, 16,000 or 16K Hz).
For Example :
format = 16k_int16
format = wav
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
domain : 'generic' ,
format : "16k_int16" ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
logging
Possible Values are:
true
- stores audio and keep transcripts in logs.
no_audio
- does not store audios but keep transcripts in logs.
no_transcript
- does not keep transcripts in logs but stores audios.
false
- does not keep neither audios nor transcripts in log.
Default value is true
For Example :
logging = true
logging = false
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
logging : true ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
punctuate
It will enable punctuation and capitalisation in the transcript. The values it can take are true
and false
. Supported languages are: en
, hi
. Default value is true
For Example :
punctuate = true
punctuate = false
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
punctuate : true ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;
continuous
It will enable continuous decoding even after silence is detected. Can take value true
/1
or false
/0
. Default value is false
/0
For Example :
continuous = true
continuous = false
const initGenericSTT = async ( ) => {
const config = {
apikey : < YOUR - API - KEY > ,
appId : < YOUR - APP - ID > ,
language : 'hi' ,
continuous : true ,
eventHandler : ( event ) => voiceText ( event) ,
errorHandler : ( error ) => console . log ( 'Generic STT Error:' , error) ,
} ;
await window . stt_stream . initSTT ( config) ;
} ;