1 Star 0 Fork 0

kade / google-tts-stt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
stt.go 649 Bytes
一键复制 编辑 原始数据 按行查看 历史
kadegolang 提交于 2023-11-20 12:15 . 初步完成
package api
import (
"fmt"
"net/http"
"gitee.com/go-kade/google-tts-stt/stt"
"github.com/gin-gonic/gin"
)
// RequestSTT is a struct to represent the JSON request for TTS API.
type RequestSTT struct {
Path string `json:"path"` // Use correct JSON tag
// Id int `json:"id"`
}
// STTApi handles the Speech-to-Text API (currently commented out).
func STTApi(g *gin.Context) {
// stt.STT()
var path RequestSTT
if err := g.BindJSON(path); err != nil {
g.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Call the STT function with the received text
fmt.Println("path:--------", path.Path)
stt.STT(path.Path)
}
1
https://gitee.com/go-kade/google-tts-stt.git
git@gitee.com:go-kade/google-tts-stt.git
go-kade
google-tts-stt
google-tts-stt
47dc74e4c5ca

搜索帮助