Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f06c696fa |
@@ -34,13 +34,13 @@ type result struct {
|
||||
var DefaultTTS = &AliTTS{}
|
||||
|
||||
// onTaskFailed TTS 合成失败回调
|
||||
func (tts *AliTTS) onTaskFailed(text string, param interface{}) {
|
||||
func (tts *AliTTS) onTaskFailed(text string, param any) {
|
||||
p, _ := param.(*result)
|
||||
p.Error = fmt.Errorf("语音合成异常: %v", text)
|
||||
}
|
||||
|
||||
// onSynthesisResult TTS 合成数据回调
|
||||
func (tts *AliTTS) onSynthesisResult(data []byte, param interface{}) {
|
||||
func (tts *AliTTS) onSynthesisResult(data []byte, param any) {
|
||||
p, _ := param.(*result)
|
||||
p.Data.Write(data)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func Play(ctx context.Context, path string, local bool) error {
|
||||
done := make(chan struct{})
|
||||
defer close(done)
|
||||
|
||||
_, err = eventManager.Attach(libvlc.MediaPlayerEndReached, func(libvlc.Event, interface{}) {
|
||||
_, err = eventManager.Attach(libvlc.MediaPlayerEndReached, func(libvlc.Event, any) {
|
||||
done <- struct{}{}
|
||||
}, nil)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user