iceking2nd / htgo-tts

Text to speech package for Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.")

Have Fun!

About

Text to speech package for Golang.

License:MIT License


Languages

Language:Go 100.0%