Documentation
¶
Index ¶
- Constants
- type SaluteSpeechApi
- func (s *SaluteSpeechApi) Auth() (int64, string)
- func (s *SaluteSpeechApi) GetVoiceById(voice_id string) *Voice
- func (s *SaluteSpeechApi) Recognize(data io.Reader) (*SpeechRecognizeAnswer, error)
- func (s *SaluteSpeechApi) RecognizeFile(filename string) (*SpeechRecognizeAnswer, error)
- func (s *SaluteSpeechApi) Synthesize(text2speech_or_ssml string) (io.Reader, error)
- func (s *SaluteSpeechApi) SynthesizeToFile(filename string, text2speech_or_ssml string) error
- type SpeechRecognizeAnswer
- type TokenResponse
- type Voice
Constants ¶
View Source
const ( SaluteSpeechApi_InputAudioTypePCM_S16LE = "PCM_S16LE" SaluteSpeechApi_InputAudioTypeOPUS = "OPUS" SaluteSpeechApi_InputAudioTypeMP3 = "MP3" SaluteSpeechApi_InputAudioTypeFLAC = "FLAC" SaluteSpeechApi_InputAudioTypeALAW = "ALAW" SaluteSpeechApi_InputAudioTypeMULAW = "MULAW" SaluteSpeechApi_OutputAudioTypeWAV16 = "wav16" SaluteSpeechApi_OutputAudioTypePCM16 = "pcm16" SaluteSpeechApi_OutputAudioTypeOPUS = "opus" SaluteSpeechApi_OutputAudioTypeALAW = "alaw" )
View Source
const ( SaluteSpeechApiRestURL = "https://smartspeech.sber.ru/rest/v1/" SaluteSpeechOauthUrl = "https://ngw.devices.sberbank.ru:9443/api/v2/oauth" SaluteSpeechTokenFileEnv = "SALUTE_TOKEN_FILE" SaluteSpeechExpiresFileEnv = "SALUTE_EXPIRES_FILE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SaluteSpeechApi ¶
type SaluteSpeechApi struct {
AudioType string
Voice *Voice
Rate int
ValidateVoiceName bool
Debug bool
}
func NewSaluteSpeechApi ¶
func NewSaluteSpeechApi() *SaluteSpeechApi
func (*SaluteSpeechApi) Auth ¶
func (s *SaluteSpeechApi) Auth() (int64, string)
func (*SaluteSpeechApi) GetVoiceById ¶
func (s *SaluteSpeechApi) GetVoiceById(voice_id string) *Voice
func (*SaluteSpeechApi) Recognize ¶
func (s *SaluteSpeechApi) Recognize(data io.Reader) (*SpeechRecognizeAnswer, error)
func (*SaluteSpeechApi) RecognizeFile ¶
func (s *SaluteSpeechApi) RecognizeFile(filename string) (*SpeechRecognizeAnswer, error)
func (*SaluteSpeechApi) Synthesize ¶
func (s *SaluteSpeechApi) Synthesize(text2speech_or_ssml string) (io.Reader, error)
func (*SaluteSpeechApi) SynthesizeToFile ¶
func (s *SaluteSpeechApi) SynthesizeToFile(filename string, text2speech_or_ssml string) error
type SpeechRecognizeAnswer ¶
type SpeechRecognizeAnswer struct {
Result []string `json:"result"`
Emotions []struct {
Negative float64 `json:"negative"`
Neutral float64 `json:"neutral"`
Positive float64 `json:"positive"`
} `json:"emotions,omitempty"`
PersonIdentity struct {
Age string `json:"age"`
Gender string `json:"gender"`
AgeScore int `json:"age_score"`
GenderScore int `json:"gender_score"`
} `json:"person_identity,omitempty"`
Status int `json:"status"`
}
type TokenResponse ¶
Click to show internal directories.
Click to hide internal directories.