Create a config JSONwith absolute paths to*.onnx,tokens.txt, and theespeak-ng-datafolder. Initialize, then generate or stream speech. importTTSManagerfrom'react-native-sherpa-onnx-offline-tts';importRNFSfrom're
ONNX Runtime React Native provides a JavaScript library for running ONNX models in a React Native app. Why ONNX models The Open Neural Network Exchange (ONNX) is an open standard for representing machine learning models. The biggest advantage of ONNX is that it allows interoperability across ...
import TTSManager from 'react-native-sherpa-onnx-offline-tts'; // ... // Initialize with a male voice model TTSManager.initialize('male'); // Or initialize with a female voice model TTSManager.initialize('female'); const text = "Hello, this is a test message."; const speakerId = ...