1234567891011121314151617181920212223242526272829303132333435363738 |
- package mysql
-
- const ttsCollection = `lnk_corpus_tts`
- type Tts struct {
- ID int64 `db:"id"`
- Text string `db:"text"` //翻译的文本
- UniqKey string `db:"uniq_key"` //唯一键值
- LanguageCode string `db:"language_code"` //'en-US','en-GB','zh-CN'
- VoiceName string `db:"voice_name"` //发音名称
- Speed float64 `db:"speed"`
- Pitch float64 `db:"pitch"`
- Url string `db:"url"`
- }
-
- func CreateCorpusTts(text, uniqKey, languageCode, voiceName, url string, speed, pitch float64) error {
-
- var tts = &Tts{
- Text: text,
- UniqKey: uniqKey,
- LanguageCode: languageCode,
- VoiceName: voiceName,
- Url: url,
- Speed: speed,
- Pitch: pitch,
- }
-
- _, err := db_session.Collection(ttsCollection).Insert(tts)
- if err != nil {
- return err
- }
-
- return nil
- }
-
- func GetByKey(uniqKey string) error {
-
- return nil
- }
|