A Small Tool for Converting Text to Speech and Playing Speech Based on Xunfei Web Api 讯飞在线语音合成(Xunfei online tts web api).
- Linux
- Windows/macOS(Untested)
go install -v github.com/happystraw/text-player@latest
-
Register a Xunfei online tts web api application. If you already have one, ignore this step.
-
Set the
APPID
,APIKey
andAPISecret
of Xunfei online tts web api to default configuration for Text Player.text-player config --appid 'your appid' --apikey 'your apikey' --apisecret 'your apisecret'
text-player play "富强、民主、文明、和谐、自由、平等、公正、法治、爱国、敬业、诚信、友善"
# default listen at localhost:8888
text-player serve
Test
# POST HTTP/1.1
# Host: localhost:8888
#
# Content-Disposition: form-data; name="msg"
#
# Hello, China
# ------WebKitFormBoundary7MA4YWxkTrZu0gW--
curl -d "msg=Hello, China" localhost:8888
- Use "text-player --help" for more information about this application.
Text Player is released under the Apache 2.0 license. See LICENSE