TTS Plugin
Legacy documentation
This page contains deprecated documentation and is no longer actively maintained. A new version of this documentation is now available here.
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 intall --save-dev @deltatre-vxp/diva-plugin-tts
Usage​
- Web TV
Reactjs version​
import { Tts, Platform } from '@deltatre-vxp/diva-plugin-tts';
const tts = new Tts(
process.env.PLATFORM === 'TIZEN' ?
Platform.TIZEN :
process.env.PLATFORM === 'WEBOS' ?
Platform.WEBOS :
Platform.WEB
);
// ...
<DivaWebTV
// ...
onTtsMessage={tts.onTts}
// ...
/>
Vanilla js version​
import { Tts, Platform } from '@deltatre-vxp/diva-plugin-tts';
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
// ...
});