mixer

package
v0.0.0-...-ea0be8e Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	VC *discordgo.VoiceConnection
	// contains filtered or unexported fields
}

Encoder is a discordgo voice encoder that can mix streams

func NewEncoder

func NewEncoder() *Encoder

NewEncoder gives a new Encoder

func (*Encoder) HasFinishedAll

func (e *Encoder) HasFinishedAll() bool

HasFinishedAll returns true if all streams have no more audio to play

func (*Encoder) Queue

func (e *Encoder) Queue(id uint64, path string)

Queue queues a WAV file input for a stream ID, different IDs live mix the audio, same IDs play on serial

func (*Encoder) Run

func (e *Encoder) Run()

Run runs the encoder

func (*Encoder) Stop

func (e *Encoder) Stop()

Stop stops the encoder

type InputStream

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

InputStream is the type used to control an input file stream

func NewInputStream

func NewInputStream(id uint64) *InputStream

NewInputStream gives a new InputStream for a given ID

func (*InputStream) HandleFile

func (is *InputStream) HandleFile(path string)

HandleFile handles an a WAV file decoding

func (*InputStream) Read

func (is *InputStream) Read(b []int16) (n int, err error)

Read gives back a buffer for the audio file, implements io.Reader

Jump to

Keyboard shortcuts

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