TTS Plugin
TV platforms |
---|
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​
- Add
@deltatre-vxp:registry=https://npm.pkg.github.com
to your.npmrc
file - Install the SDK
npm i --save @deltatre-vxp/diva-plugin-tts
Usage​
- Web TV
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
// ...
});