ttscn

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ttscn https://www.text-to-speech.cn/

Index

Constants

This section is empty.

Variables

View Source
var (
	// Langs 语言
	Langs = func() (m map[string]*LangSpeakers) {
		data, err := web.GetData(speakerlistapi)
		if err != nil {
			_ = json.Unmarshal(embededspeakers, &m)
			return
		}
		err = json.Unmarshal(data, &m)
		if err != nil {
			_ = json.Unmarshal(embededspeakers, &m)
			return
		}
		return
	}()
	// KBRates 质量
	KBRates = [...]string{
		"audio-16khz-32kbitrate-mono-mp3",
		"audio-16khz-128kbitrate-mono-mp3",
		"audio-24khz-160kbitrate-mono-mp3",
		"audio-48khz-192kbitrate-mono-mp3",
		"riff-16khz-16bit-mono-pcm",
		"riff-24khz-16bit-mono-pcm",
		"riff-48khz-16bit-mono-pcm",
	}
)

Functions

This section is empty.

Types

type LangSpeakers

type LangSpeakers struct {
	ShortName []string // ShortName 用于 API
	LocalName []string // LocalName 用于显示
}

LangSpeakers ...

type TTS

type TTS struct {
	// contains filtered or unexported fields
}

TTS 类

func NewTTSCN

func NewTTSCN(lang, speaker, kbrate string) (*TTS, error)

NewTTSCN ...

func (*TTS) Speak

func (tts *TTS) Speak(_ int64, text func() string) (fileName string, err error)

Speak 返回音频本地路径

func (*TTS) String

func (tts *TTS) String() string

String 服务名

Jump to

Keyboard shortcuts

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