1.0.1 • Published 10 months ago

aliyun-nls-js v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

aliyun-nls-js

Aliyun NLS (Natural Language Processing) JavaScript SDK for the Browser

Usage

import { AliyunTTS } from "aliyun-nls-js"

const tts = new AliyunTTS({
  accessKeyId: <accessKeyId>,
  accessKeySecret: <accessKeySecret>,
  appKey: <appKey>,
})

const playAudio = (src) => {
  audioRef.current.src = src
  audioRef.current.play()
}

const handlePlay = async (message) => {
  const src = await tts.fetchStream("This is my text")
  playAudio(src)
}

<audio ref={audioRef}></audio>
<button onClick={playAudio}>play audio</button>
1.0.1

10 months ago

1.0.0

1 year ago