Skip to main content

TTS Plugin

TV platforms
Web TV

DIVA TTS Plugin​

The DIVA TTS plugin is an out-of-the-box implementation of text to speech for supporting voice over for accessibility.

Installation​

  1. Add @deltatre-vxp:registry=https://npm.pkg.github.com to your .npmrc file
  2. Install the SDK
    npm i --save @deltatre-vxp/diva-plugin-tts

Usage​

Reactjs version​

import { Tts } from "@deltatre-vxp/diva-plugin-tts";
import { TtsPlatform } from "@deltatre-vxp/diva-web-types";

const tts = new Tts(
process.env.PLATFORM === 'TIZEN' ?
Platform.TIZEN :
process.env.PLATFORM === 'WEBOS' ?
Platform.WEBOS :
Platform.WEB
);

// ...

<DivaWebTvBoAdapter
// ...
onTtsMessage={tts.onTts}
// ...
/>

Vanilla js version​

import { Tts } from "@deltatre-vxp/diva-plugin-tts";
import { TtsPlatform } from "@deltatre-vxp/diva-web-types";

const tts = new Tts(
process.env.PLATFORM === 'TIZEN' ?
Platform.TIZEN :
process.env.PLATFORM === 'WEBOS' ?
Platform.WEBOS :
Platform.WEB
);

const diva = new divaWebtv.createDivaWebTV (el, {
// ...
onTtsMessage: tts.onTts
// ...
});