ytts

package module
v0.0.0-...-9dac2a6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 9 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 {
	// contains filtered or unexported fields
}

func New

func New(token string, opts ...Option) *Client

New initializes a new speechkit client.

func (*Client) Synthesize

func (c *Client) Synthesize(ctx context.Context, opt Options) (io.ReadCloser, error)

Synthesize synthesizes speech from the given text.

type Error

type Error struct {
	Code    string `json:"error_code"`
	Message string `json:"error_message"`
}

func (*Error) Error

func (e *Error) Error() string

type HTTP

type HTTP interface {
	Do(req *http.Request) (*http.Response, error)
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithFolderID

func WithFolderID(id string) Option

WithFolderID sets the folder to use.

func WithHTTP

func WithHTTP(h HTTP) Option

WithHTTP sets the HTTP client to use.

type Options

type Options struct {
	Text     string  `url:"text"`
	Language string  `url:"lang"`    // ru-RU, en-US, ...
	Speed    float64 `url:"speed"`   // 0.1 - 3.0
	Voice    string  `url:"voice"`   // omazh (f), zahar (m), jane (f)
	Emotion  string  `url:"emotion"` // good, neutral, evil
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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