dgvoice

package
v0.0.0-...-e14f300 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dgvoice provides opus encoding and audio file playback for the Discordgo package.

Index

Constants

This section is empty.

Variables

View Source
var OnError = func(str string, err error) {
	prefix := "dgVoice: " + str

	if err != nil {
		os.Stderr.WriteString(prefix + ": " + err.Error())
	} else {
		os.Stderr.WriteString(prefix)
	}
}

OnError gets called by dgvoice when an error is encountered. By default logs to STDERR

Functions

func PlayAudio

func PlayAudio(v *discordgo.VoiceConnection, ffmpegInputArg string, playbackController *PlaybackController)

Types

type PlaybackController

type PlaybackController struct {
	// contains filtered or unexported fields
}

func NewPlaybackController

func NewPlaybackController() *PlaybackController

func (*PlaybackController) ElapsedTime

func (playbackController *PlaybackController) ElapsedTime() time.Duration

func (*PlaybackController) Pause

func (playbackController *PlaybackController) Pause() error

func (*PlaybackController) Paused

func (playbackController *PlaybackController) Paused() bool

func (*PlaybackController) Reset

func (playbackController *PlaybackController) Reset()

func (*PlaybackController) Resume

func (playbackController *PlaybackController) Resume() error

func (*PlaybackController) Skip

func (playbackController *PlaybackController) Skip() error

Jump to

Keyboard shortcuts

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