sounds

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: MIT Imports: 17 Imported by: 0

README

Conversion

MP3 to DCA:

ffmpeg -i birthcontrol.mp3 -f s16le -ar 48000 -ac 2 pipe:1 | dca > birthcontrol.dca

Documentation

Index

Constants

View Source
const StartEndFormatting = "```"

Variables

View Source
var COLLECTIONS = SoundCollections{
	airhorn,
	khaled,
	cena,
	ethan,
	cow,
	birthday,
	wow,
	vince,
	trump,
}
View Source
var HelpStringGlobal = ""

Functions

This section is empty.

Types

type Options

type Options struct {
	Bitrate            int    `yaml:"bitrate" json:"bitrate"`
	MaxQueueSize       int    `yaml:"max_queue" json:"max_queue"`
	AdminUserSnowflake string `yaml:"admin_user_id" json:"admin_user_id"`
	AudioPath          string `yaml:"audio_path" json:"audio_path"`
}

type Play

type Play struct {
	GuildID   string
	ChannelID string
	UserID    string
	Sound     *Sound

	// The next play to occur after this, only used for chaining sounds like anotha
	Next *Play

	// If true, this was a forced play using a specific airhorn sound name
	Forced bool
}

Play represents an individual use of the !airhorn command

type Sound

type Sound struct {
	Name string

	// Weight adjust how likely it is this song will play, higher = more likely
	Weight int

	// Delay (in milliseconds) for the bot to wait before sending the disconnect request
	PartDelay int
	// contains filtered or unexported fields
}

Sound represents a sound clip

func (*Sound) Load

func (s *Sound) Load(basePath string, c *SoundCollection) error

Load attempts to load an encoded sound file from disk DCA files are pre-computed sound files that are easy to send to Discord. If you would like to create your own DCA files, please use: https://github.com/nstafie/dca-rs eg: dca-rs --raw -i <input wav file> > <output file>

func (*Sound) Play

func (s *Sound) Play(vc *discordgo.VoiceConnection)

Plays this sound over the specified VoiceConnection

type SoundBotPlugin

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

func (*SoundBotPlugin) Destroy

func (s *SoundBotPlugin) Destroy() error

func (*SoundBotPlugin) InstallRoute

func (s *SoundBotPlugin) InstallRoute(f haleakala.InstallFunc) error

func (*SoundBotPlugin) Name

func (s *SoundBotPlugin) Name() string

func (*SoundBotPlugin) OnMessage

func (s *SoundBotPlugin) OnMessage(c *muxer.Context)

func (*SoundBotPlugin) SupportsUnload

func (s *SoundBotPlugin) SupportsUnload() bool

type SoundCollection

type SoundCollection struct {
	Prefix    string
	Commands  []string
	Sounds    []*Sound
	ChainWith *SoundCollection
	// contains filtered or unexported fields
}

func (*SoundCollection) Load

func (sc *SoundCollection) Load(basePath string)

func (*SoundCollection) Random

func (s *SoundCollection) Random() *Sound

type SoundCollections

type SoundCollections []*SoundCollection

func (*SoundCollections) GetFullList

func (s *SoundCollections) GetFullList() map[string][]string

Jump to

Keyboard shortcuts

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