Giter VIP home page Giter VIP logo

ontts's Introduction

ontts

ontts 是语音合成服务,调用的科大讯飞的在线语音合成服务,含用go封装在线合成linux的SDK,单次合成与后台合成服务两种模式,后台合成服务是订阅redis中的数据,一有待合成的文本立马合成并存储到磁盘

安装

go get github.com/imroc/ontts

运行

需要将libmsc.so加入环境变量

cp xf/lib/x64/libmsc.so /usr/local/lib/
vi ~/.bashrc

export LD_LIBRARY_PATH = /usr/local/lib

使用示例

单次合成:
./ontts -t "云喇叭快递,快递小管家,您的快递到了,请于下午6点前到学校后门申通快递取件" -o test.wav -lp "appid = 5808ae7e, work_dir = ."
启动合成后台服务:
./ontts -r ":6379" -d /tmp/out -lp "appid = 5808ae7e, work_dir = ."

redis数据

后台合成的服务是订阅的redis中"tts"的通道中的数据,redis发布数据示例:

redis-cli>publish tts "{\"id\":\"245671051\",\"txt\":\"这是一段测试语音\"}"

命令参数

讯飞语音参数选项:
    -tp                  TTS合成参数[有默认值]
    -lp                  登录参数

单次合成模式选项:
    -t                 	待合成的文本
    -o                	音频输出路径 

合成服务模式选项:
    -d                     音频保存的目录 
    -s                   合成速度级别(1-10),数值越小速度越快,越耗CPU[默认为1]
    -r                    redis连接地址
    -rp                   redis密码

日志选项:
    -l                    日志输出路径[默认./ontts.log]
    -ll                  日志输出级别(debug,info,warn,error)

其他:
    -h                          查看帮助 

目录

── ontts
   ├── glide.yaml (glide依赖配置)
   ├── main.go (程序入口)
   ├── README.md
   ├── server (TTS合成主体逻辑的package)
   │   └── server.go
   ├── speed_test.go (速度测试)
   └── xf (讯飞SDK的Go封装)
       ├── doc (讯飞语音linux SDK相关参考)
       ├── include (cgo需要用到的头文件)
       ├── lib (动态链接库 SDK)
       │   └── libmsc.so
       ├── README.md
       └── xf.go

ontts's People

Contributors

imroc avatar

Watchers

Robert Liu avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.