voicemod

package
v0.0.0-...-b5fa7f3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StopWord = `#stop`
)

Variables

View Source
var (
	DefaultVoiceFormat = beep.Format{
		Precision:   2,
		NumChannels: 1,

		SampleRate: 22050 / 2,
	}
	ChatPat         = regexp.MustCompile(`^(?:[*](?:DEAD|SPEC)[*])?\s*(?:\([^)]+\))?\s*(.+?)\s*:\s*(?:[#]|:\s?>|:\s?<|<\s?:|>\s?:)\s*(.+?)\s*$`)
	CvarPat         = regexp.MustCompile(`^(?:\[[^\]]+\])?"?([^"]+)"?\s*=\s*"([^"]*)"`)
	GamePathPat     = regexp.MustCompile(`(?i)^GAME\s.*"([^"]+[/\\]steamapps[/\\]common)[/\\]+([^/\\"]+)`)
	FlatpakPat      = regexp.MustCompile(`^\w+:([\\].+)`)
	ConnectPat      = regexp.MustCompile(`(?i)^\s*(.*)\s*(connected|disconnected|Not connected to server)\s*$`)
	StatusPat       = regexp.MustCompile(`^#\s+\d+(?:\s+\d+)?\s+"([^"]+)".+(STEAM_\d+:\d+:\d+|BOT)`)
	StatusServerPat = regexp.MustCompile(`^\s*Connected to (\S+:\d+)\s*$`)

	StatusTableBegin = `# userid name uniqueid connected ping loss state rate`
	StatusTableEnd   = `#end`

	ErrPassword = errors.New("Password is incorrect and/or not set")
)

Functions

func Run

func Run(ctx context.Context, app App) error

Types

type App

type App interface {
	Store() *store.DB
	State() appstate.AppState
	Logs() *logs.Logger
	Limiter(name string) *rate.Limiter
	TTS(key string) *piper.TTS
	VoiceModStopped(err error)
	VoiceModGame(ts time.Time, game *steam.GameInfo, gameDir string)
	VoiceModPresence(ts time.Time, server string, hums, bots data.SliceSet[steam.Profile])
	VoiceModServerDisconnected()
	VoiceModNetcon() (Conn, error)
	DedicatedGameDir() string
}

type Conn

type Conn interface {
	io.Reader
	io.Writer
	io.Closer
	ReadString(byte) (string, error)
}

type X

type X = []string

Jump to

Keyboard shortcuts

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