hegedustibor / htgo-tts

Text to speech package for Golang.
MIT License
180 stars 46 forks source link

Error when playing audio using Native Handler more than once #31

Open orlandoleone opened 2 months ago

orlandoleone commented 2 months ago

The following error occurs when I try playing audio using the Native handler more than once.

SIGSEGV: segmentation violation PC=0x18a4e9334 m=4 sigcode=2 addr=0x0 signal arrived during cgo execution

Specifically, the first TTS audio file plays, and then the error occurs without playing the second audio file.

This is my code:

package main

import (
    htgotts "github.com/hegedustibor/htgo-tts"
    handlers "github.com/hegedustibor/htgo-tts/handlers"
    voices "github.com/hegedustibor/htgo-tts/voices"
)

func TTS() {
    speech := htgotts.Speech{Folder: "audio", Language: voices.English, Handler: &handlers.Native{}}
    speech.Speak("hello")
    speech.Speak("goodbye")
}

func main() {
    TTS()
}

How can I fix this?

Master-of-the-Ice24 commented 1 month ago

I'll suggest to try with MPlayer and maybe call the method "Speak" 1 time only