tts

package
v0.0.0-...-bb841d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Advanced = advanced{}
View Source
var AdvancedStart = advancedStart{}
View Source
var AdvancedStop = advancedStop{}
View Source
var AdvancedSubOnly = advancedSubOnly{}
View Source
var AdvancedSubOnlyOff = advancedSubOnlyOff{}
View Source
var AdvancedSubOnlyOn = advancedSubOnlyOn{}
View Source
var AdvancedSubOnlyShow = advancedSubOnlyShow{}
View Source
var AdvancedVoice = advancedVoice{}
View Source
var AdvancedVoiceSet = advancedVoiceSet{}
View Source
var AdvancedVoiceShow = advancedVoiceShow{}
View Source
var Hooks = gosafe.Map[string, *Entry]{}
View Source
var NormalSubOnly = normalSubOnly{}
View Source
var NormalSubOnlyOff = normalSubOnlyOff{}
View Source
var NormalSubOnlyOn = normalSubOnlyOn{}
View Source
var NormalTTS = normalTTS{}
View Source
var NormalVoice = normalVoice{}

NormalVoice is not a sub-command

View Source
var (
	UrrHookNotFound = core.UrrNew("Wasn't monitoring, what are you even trynna do??")
)
View Source
var Voices = []string{

	"en_us_ghostface",
	"en_us_chewbacca",
	"en_us_c3po",
	"en_us_stitch",
	"en_us_stormtrooper",
	"en_us_rocket",
	"en_female_madam_leota",
	"en_male_ghosthost",
	"en_male_pirate",

	"en_au_001",
	"en_au_002",
	"en_uk_001",
	"en_uk_003",
	"en_us_001",
	"en_us_002",
	"en_us_006",
	"en_us_007",
	"en_us_009",
	"en_us_010",

	"fr_001",
	"fr_002",
	"de_001",
	"de_002",
	"es_002",

	"es_mx_002",
	"br_001",
	"br_003",
	"br_004",
	"br_005",

	"id_001",
	"jp_001",
	"jp_003",
	"jp_005",
	"jp_006",
	"kr_002",
	"kr_003",
	"kr_004",

	"en_male_narration",
	"en_male_funny",
	"en_female_emotional",
	"en_male_cody",
}

Functions

func Start

func Start(sp core.AudioSpeaker, twitchUsername string)

Start will create a hook and will monitor all incoming messages, if they are from twitch and match the specified username then the the TTS audio will be sent to the specified speaker.

func Stop

func Stop(twitchUsername string) (core.Urr, error)

Stop will delete the hook created by Start. Returns UrrHookNotFound if the hook doesn't exist.

func SubOnlyGet

func SubOnlyGet(place int64) (bool, error)

SubOnlyGet returns the sub-only state for the specified place.

func SubOnlySet

func SubOnlySet(place int64, state bool) error

SubOnlySet sets the sub-only state for the specified place.

func TTS

func TTS(voice, text string) ([]byte, error)

TTS will return a slice of bytes containing the audio generated by the TikTok TTS. You need to have the TikTokSessionID global set.

func VoiceGet

func VoiceGet(person, place int64) (string, error)

VoiceGet returns the person's voice in this place. If no voice has been set then it picks a random one and saves it.

func VoiceSet

func VoiceSet(person, place int64, voice string) error

VoiceSet sets the user voice.

Types

type Entry

type Entry struct {
	HookID  int
	Speaker core.AudioSpeaker
	Player  *core.AudioPlayer[Message]
}

type Message

type Message struct {
	Voice string
	Text  string
}

type TTSResp

type TTSResp struct {
	Data struct {
		SKey     string `json:"s_key"`
		VStr     string `json:"v_str"`
		Duration string `json:"duration"`
		Speaker  string `json:"speaker"`
	} `json:"data"`
	Extra struct {
		LogID string `json:"log_id"`
	} `json:"extra"`
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
	StatusMsg  string `json:"status_msg"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL