Skip to content

hegedustibor/htgo-tts

Repository files navigation

HTGO-TTS

htgo-tts

https://hegedustibor.github.io/htgo-tts/

Requirement:

  • mplayer (optional)

Install

go get "github.com/hegedustibor/htgo-tts"

Update

go get -u "github.com/hegedustibor/htgo-tts"

Remove

go clean -i "github.com/hegedustibor/htgo-tts"

Import

import "github.com/hegedustibor/htgo-tts"
import "github.com/hegedustibor/htgo-tts/voices"

Use

speech := htgotts.Speech{Folder: "audio", Language: voices.English}
speech.Speak("Your sentence.")

Use with Handlers

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

speech := htgotts.Speech{Folder: "audio", Language: voices.English, Handler: &handlers.MPlayer{}}
speech.Speak("Your sentence.")

Use tts without external player

Note: The "Native" handler works around the Oto librery, see the "Prerequisite" section to work with this handler

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

speech := htgotts.Speech{Folder: "audio", Language: voices.English, Handler: &handlers.Native{}}
speech.Speak("Your sentence.")

Use with Proxy

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

speech := htgotts.Speech{Folder: "audio", Language: voices.English, Proxy: "https://..."}
speech.Speak("Your sentence.")

Support and Contributions

If you encounter issues using HTGO-TTS or would like to suggest improvements to the source code, you can create an issue on the "Issues" tab. If you'd like to contribute to the HTGO-TTS source code, please submit a pull request.

License

HTGO-TTS is free software and is available under the MIT license. For more information, please see the LICENSE file in the source code repository.

Have Fun!