ITRI TTS async for Node.js
This tool let you use Node.js to operate ITRI TTS Web service.You must register a account of the service before using this tool.
The service uses the UTF-8 format and Simple Object Access Protocol (SOAP), and provides a synthetic audio file for downloading.
When TTS converting success, you can browse the Synthetic history in offcial site.
這個工具讓你使用Node.js來操作工研院文字轉語音Web服務。在使用此工具之前,您需要註冊該服務的帳戶。
該服務使用UTF-8格式和簡單物件存取協定(SOAP),並提供用於下載的合成音頻文件。
當TTS轉換成功時,您可以在官方網站瀏覽合成歷史記錄
install
npm i itri-tts-async
Reference
Documentation
Check out Documentation
Description
All Method are async
function.You can use Promise.prototype.then()
, or use await
in your async
function.
Fist you must use your account to create a Promise to request SOAP Client then passing TTSClient
object :
const ITRITTS = ; //Return Promiselet tts = ITRITTStts //OR return TTSClient object { let ttsClient = await ITRITTS console}
Now you can use TTSClient
converting Text to Speech. If fulfilled, you will get TTSResult
object :
......//Return Promisetts //OR return TTSResult object { ... ... let ttsResult = await ttsClient console}
If TTSResult.resultCode
is 0 (Success), use TTSResult.GetConvertStatus()
method to get TTSStatus
object :
......//Return Promisetts //OR return TTSStatus object { ... ... let ttsStatus = ttsResult console}
if TTSStatus.statusCode
is 2 (completed), the speech file url will in TTSStatus.result
.
This tool provides TTSStatus.GetConvertStatus()
method helping you to track the status by yourself :
......//Return Promisetts //OR return TTSStatus object { ... ... let newStatus = ttsStatus console}