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', // <-- Generic domain
    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:

const initGenericSTT = async () => {
  const config = {
    apikey: <YOUR-API-KEY>,
    appId: <YOUR-APP-ID>,
    language: 'hi',
    domain: 'generic',
    timeout:15, // <-- timeout = 15 seconds
    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, // <-- silence = 1 seconds
    eventHandler: (event) => voiceText(event),
    errorHandler: (error) => console.log('Generic STT Error:', error),
  };

  await window.stt_stream.initSTT(config);
};

format

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:

const initGenericSTT = async () => {
  const config = {
    apikey: <YOUR-API-KEY>,
    appId: <YOUR-APP-ID>,
    language: 'hi',
    domain: 'generic',
    format:"16k_int16", // <-- 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:

  1. true - stores audio and keep transcripts in logs.

  2. no_audio - does not store audios but keep transcripts in logs.

  3. no_transcript - does not keep transcripts in logs but stores audios.

  4. false - does not keep neither audios nor transcripts in log.

Default value is true

For Example:

const initGenericSTT = async () => {
  const config = {
    apikey: <YOUR-API-KEY>,
    appId: <YOUR-APP-ID>,
    language: 'hi',
    logging: true, // <-- 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:

const initGenericSTT = async () => {
  const config = {
    apikey: <YOUR-API-KEY>,
    appId: <YOUR-APP-ID>,
    language: 'hi',
    punctuate: true, // <-- 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:

const initGenericSTT = async () => {
  const config = {
    apikey: <YOUR-API-KEY>,
    appId: <YOUR-APP-ID>,
    language: 'hi',
    continuous: true, // <-- continuous = true
    eventHandler: (event) => voiceText(event),
    errorHandler: (error) => console.log('Generic STT Error:', error),
  };

  await window.stt_stream.initSTT(config);
};