tts

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config *Config
}

func (*Client) Run

func (c *Client) Run(text string, options ...RequestOption) ([]byte, error)

type Config

type Config struct {
	AccessKeyId     string `yaml:"access_key_id" mapstructure:"access_key_id"`
	AccessKeySecret string `yaml:"access_key_secret" mapstructure:"access_key_secret"`
	AppKey          string `yaml:"app_key" mapstructure:"app_key"`
}

func (*Config) New

func (c *Config) New() *Client

type RequestOption

type RequestOption func(*nls.SpeechSynthesisStartParam)

RequestOption 设置自定义请求参数

func SetFormat

func SetFormat(format string) RequestOption

SetFormat 设置音频格式,wav | mp3

func SetPitchRate

func SetPitchRate(num int) RequestOption

SetPitchRate 设置语调 范围是-500~500,可选,默认是0。

func SetSampleRate

func SetSampleRate(rate int) RequestOption

SetSampleRate 设置采样率 16000

func SetSpeechRate

func SetSpeechRate(num int) RequestOption

SetSpeechRate 设置语速 范围是-500~500,可选,默认是0。

func SetVoice

func SetVoice(name string) RequestOption

SetVoice 设置发音人

func SetVolume

func SetVolume(num int) RequestOption

SetVolume 设置音量,范围是0~100,可选,默认50

type UserParam

type UserParam struct {
	Content []byte //合成后的数据
}

UserParam SDK

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL