audio

package
v0.0.0-...-916f762 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Play

func Play(vc *discordgo.VoiceConnection, sample_func SampleFunc, skip chan struct{})

This function first connects the bot to voice, and then calls sample_func every 20 millis, until sample_func returns either an error or a nil array. This is a blocking call.

Types

type SampleFunc

type SampleFunc func(samplerate, num_samples, time int64) ([]int16, error)

This is used in play_audio, and is called once every 20 millis.

func NoteSampler

func NoteSampler(note float64) SampleFunc

This returns a sample_func which plays a constant sin wave, given a note in hz.

func WavSampler

func WavSampler(wav *bytes.Buffer) SampleFunc

Jump to

Keyboard shortcuts

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