npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

itri-tts-async

v1.0.3

Published

This tool let you use Node.js to operate ITRI TTS Web service.

Downloads

8

Readme

npm version

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 :

require('dotenv').config()
const {ITRITTS} = require('itri-tts-async');

//Return Promise
let tts = ITRITTS.create(process.env.Account,process.env.Password)
tts.then((ttsClient)=>{
  console.log(ttsClient)
})

//OR return TTSClient object
async function main () {
  let ttsClient = await ITRITTS.create(process.env.Account,process.env.Password)
  console.log(ttsClient)
}

Now you can use TTSClient converting Text to Speech. If fulfilled, you will get TTSResult object :

...
...
//Return Promise
tts.then((ttsClient)=>{
  return ttsClient.ConvertSimple("Hello,world.我是Bruce!這是一個Node.js測試。")
}).then((ttsResult) => {
  console.log(ttsResult)
})

//OR return TTSResult object
async function main () {
  ...
  ...
  let ttsResult = await ttsClient.ConvertSimple("Hello,world.我是Bruce!這是一個Node.js測試。")
  console.log(ttsResult)
}

If TTSResult.resultCode is 0 (Success), use TTSResult.GetConvertStatus() method to get TTSStatus object :

...
...
//Return Promise
tts.then((ttsClient)=>{
  return ttsClient.ConvertSimple("Hello,world.我是Bruce!這是一個Node.js測試。")
}).then((ttsResult) => {
  return ttsResult.GetConvertStatus()
}).then((ttsStatus)=>{
  console.log(ttsStatus)
})

//OR return TTSStatus object
async function main () {
  ...
  ...
  let ttsStatus = ttsResult.GetConvertStatus()
  console.log(ttsStatus)
}

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 Promise
tts.then((ttsClient)=>{
  return ttsClient.ConvertSimple("Hello,world.我是Bruce!這是一個Node.js測試。")
}).then((ttsResult) => {
  return ttsResult.GetConvertStatus()
}).then((ttsStatus)=>{
  console.log(ttsStatus)
  return  ttsStatus.GetConvertStatus()
}).then((newStatus)=>{
  console.log(newStatus)
})

//OR return TTSStatus object
async function main () {
  ...
  ...
  let newStatus = ttsStatus.GetConvertStatus()
  console.log(newStatus)
}