Documentation ¶
Overview ¶
Package voicetext provides a VoiceText Web API client.
Index ¶
Constants ¶
View Source
const ( EmotionHappiness = "happiness" EmotionAnger = "anger" EmotionSadness = "sadness" )
Emotions
Variables ¶
View Source
var ( SpeakerShow = speaker{ // contains filtered or unexported fields } SpeakerHaruka = speaker{ // contains filtered or unexported fields } SpeakerHikari = speaker{ // contains filtered or unexported fields } SpeakerTakeru = speaker{ // contains filtered or unexported fields } SpeakerSanta = speaker{ // contains filtered or unexported fields } SpeakerBear = speaker{ // contains filtered or unexported fields } )
Speakers
Functions ¶
Types ¶
type Client ¶
type Client interface { // TTS calls the tts API. TTS(text string, opts *TTSOptions) (*Result, error) }
Client is an interface for calling VoiceText Web API.
type ClientOptions ¶
type ClientOptions struct { // Version represents the version of VoiceText Web API. Version string }
ClientOptions represents options for a client.
type ErrMsg ¶
type ErrMsg interface {
String() string
}
ErrMsg is an interface for printing an error message returned by the API.
type Result ¶
type Result struct { // Status represents an HTTP status. Status int // Sound represents a sound data. Sound []byte // ErrMsg represents an error message. ErrMsg ErrMsg }
Result represents a result of the API call.
type TTSErrMsg ¶
type TTSErrMsg struct {
Err TTSErrMsgError `json:"error"`
}
TTSErrMsg represents an error meesage of the TTS method.
type TTSErrMsgError ¶
type TTSErrMsgError struct {
Message string `json:"message"`
}
TTSErrMsgError represents an error of the tts error message.
type TTSOptions ¶
type TTSOptions struct { // Speaker represents a speaker of the speech. Speaker speaker // Emotion represents an emotion of the speech. Emotion string // EmotionLevel represents an emotion level of the speech. EmotionLevel string // Pitch represents a pitch of the speech. Pitch int // Speed represents a speed of the speech. Speed int // Volume represents a volume of the speech. Volume int }
TTSOptions represents options for the TTS method.
Click to show internal directories.
Click to hide internal directories.