sounds

package
v0.0.0-...-3a044c6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLengthTooLong    = errors.New("file is too long")
	ErrInvalidFile      = errors.New("file is not valid")
	ErrInvalidDuration  = errors.New("duration is not valid")
	ErrInvalidStartTime = errors.New("start time is not valid")
)

Functions

func CreateDCAFile

func CreateDCAFile(path, url, startTime string, duration int) (*os.File, *os.File, error)

Converts and AAC file to a DCA file, file that can be streamed to discord VoiceChannel. Returns a the DCA file and an MP3 file that is needed to be sent as an embed to a TextChannel.

func DeleteFile

func DeleteFile(filename string) error

Delete a file based on the supplied filename

func DownloadFileFromURL

func DownloadFileFromURL(name, url string) (*os.File, error)

Download youtube video

func HashFile

func HashFile(filename string) (string, error)

Hashes file and return sha256hash as a string

func LoadSound

func LoadSound(filepath string) ([][]byte, error)

Will load an DCA file into an 2d byte slice to then be played via an opus connection

func MP3ToDCA

func MP3ToDCA(path string, f *os.File) (*os.File, error)

Converts an mp3 file to a DCA file

Types

This section is empty.

Jump to

Keyboard shortcuts

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