项目作者: titanium-codes

项目描述 :
Yandex Text to speech processor with cache and zipping all results
高级语言: Go
项目地址: git://github.com/titanium-codes/yandex-tts-processor.git
创建时间: 2017-10-18T21:43:50Z
项目社区:https://github.com/titanium-codes/yandex-tts-processor

开源协议:MIT License

下载


Yandex TTS processor

Library is used to get, zip and cache TTS responses.

Installation

  1. import (
  2. "github.com/titanium-codes/yandex-tts-processor/audiocacher"
  3. )

Usage

  1. // returns path to file, that can be easily served or used in any other way
  2. pathToFile,err := audiocacher.GetTtsForText("Your awesome text")

For example for query “Your awesome text” it will create file in path you defined in environmental variable and will look like
$YOUR_PATH$\Your awesome text.zip and this zip will contain 1 file audio.

Main features:

  • Downloads , caches, zips all tts files in specific folder that is defined in environment
  • Creates directory for files if is not exists
  • Logging of all activity
  • Can be simply dockerized and used from box
  • Fully customizable

Env vars

Essential:

  • YANDEX_KEY - key you get from yandex dashboard
  • AUDIO_PATH - full path for folder that will contain all cached tts files

Optional (If not defined will use default value):

  • DEFAULT_LANG - default language for tts (Default is russian(ru-RU), can be en-US for english, uk-UK for ukrainian or tr-TR for turkish)
  • DEFAULT_SPEED - default speed of speech (Default 1.0, can be from 0.1 till 3.0)
  • DEFAULT_EMOTION - default emotion (Default is neutral, can be neutral, evil or good)
  • DEFAULT_SPEAKER - default speaker voice (Default is oksana, can be jane, oksana, alyss ,omazh ,zahar ,ermil)
  • DEFAULT_QUALITY - default quality of audio, will work only for wav audio format (Default is hi, can be hi or lo)
  • DEFAULT_AUDIO_FORMAT - default audio format (Default is mp3, can be wav, opus)

Additional information for optional parameters can be found here

Notes

On save in cache library will encode file name in base64 and replace all slashes(/) into pipe(|) to prevent conflicts with operating system.