Documentation ¶
Index ¶
Constants ¶
const ( // YaSTTUrl is url for send speech to text requests YaSTTUrl = "https://stt.api.cloud.yandex.net/speech/v1/stt:recognize" // YaTTSUrl is url for send text to speech requests YaTTSUrl = "https://tts.api.cloud.yandex.net/speech/v1/tts:synthesize" // FormatLPCM is PCM audio format (wav) without wav header (more details in https://en.wikipedia.org/wiki/Pulse-code_modulation) FormatLPCM = "lpcm" // FormatOgg is audio ogg format FormatOgg = "oggopus" // Rate8k is rate of 8kHz Rate8k int = 8000 // Rate16k is rate of 16kHz Rate16k int = 16000 // Rate48k is rate of 48kHz Rate48k int = 48000 // LangRU is russian language LangRU = "ru-Ru" // LangEN is english language LangEN = "en-US" // LangTR is turkish language LangTR = "tr-TR" // SpeedStandard is standart speed of voice (1.0) SpeedStandard float32 = 1.0 // SpeedMostFastest is maximum speed voice (3.0) SpeedMostFastest float32 = 3.0 // SpeedSlowest is minimum speed of voice (0.1) SpeedSlowest float32 = 0.1 // VoiceOksana is Oksana voice (russian, female, standard) VoiceOksana = "oksana" // VoiceJane is Jane voice (russian, female, standard) VoiceJane = "jane" // VoiceOmazh is Omazh voice (russian, female, standard) VoiceOmazh = "omazh" // VoiceZahar is Zahar voice (russian, male, standard) VoiceZahar = "zahar" // VoiceErmil is Ermil voice (russian, male, standard) VoiceErmil = "ermil" // VoiceSilaerkan is Silaerkan voice (turkish, female, standard) VoiceSilaerkan = "silaerkan" // VoiceErkanyavas is Erkanyavas voice (turkish, male, standard) VoiceErkanyavas = "erkanyavas" // VoiceAlyss is Alyss voice (english, female, standard) VoiceAlyss = "alyss" // VoiceNick is Nick voice (engish, male, standard) VoiceNick = "nick" // VoiceAlena is Alena voice (russian, female, premium) VoiceAlena = "alena" // VoiceFilipp is Filipp voice (russian, male, premium) VoiceFilipp = "filipp" // EmotionGood is good voice emotion EmotionGood = "good" // EmotionEvil is evil voice emotion EmotionEvil = "evil" // EmotionNeutral is neutral voice emotion EmotionNeutral = "neutral" // TopicGeneral is current version of voice model (available in all languages) TopicGeneral = "general" // TopicGeneralRC is experimental version of voice model (russian language) TopicGeneralRC = "general:rc" // TopicGeneralDeprecated is deprecated version of voice model (russian language) TopicGeneralDeprecated = "general:deprecated" // TopicMaps is model for addresses anc company names TopicMaps = "maps" // SexAll is male and female SexAll = 0 // SexMale is male SexMale = 1 // SexFemale is female SexFemale = 2 )
Variables ¶
This section is empty.
Functions ¶
func EncodePCMToWav ¶
EncodePCMToWav encode input stream of pcm audio format to wav and write to out stream
func SpeechToTextShort ¶
SpeechToTextShort returns text from a PCM or OGG sound stream using the service Yandex Speech Kit
func TextToSpeech ¶
func TextToSpeech(config *TTSConfig) (io.ReadCloser, error)
TextToSpeech returns PCM or OGG sound stream using the service Yandex Speech Kit. Result PCM stream can be converted to Wav stream using EncodePCMToWav
Types ¶
type STTConfig ¶
type STTConfig struct { Lang string Topic string ProfanityFilter bool Format string Rate int YaFolderID string YaAPIKey string Data io.Reader }
STTConfig is config for speech to text methods
type TTSConfig ¶
type TTSConfig struct { Text string SSML string Lang string Voice string Emotion string Speed float32 Format string Rate int YaFolderID string YaAPIKey string }
TTSConfig is config for text to speeh method
func TTSDefaultConfigSSML ¶
TTSDefaultConfigSSML returns config with default parameters for raw text recognition and use in TextToSpeech method more details of SSML language in https://cloud.yandex.ru/docs/speechkit/tts/ssml
func TTSDefaultConfigText ¶
TTSDefaultConfigText returns config with default parameters for raw text recognition and use in TextToSpeech method