dgvoice

package module
v0.0.0-...-f42d99b Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

README

dgVoice

This package adds opus audio and play file support for Discordgo.

Include this along with Discordgo to add the ability to play audio files to a voice channel on Discord.

  • You must use the current develop branch of Discordgo
  • You must have ffmpeg in your path and Opus libs already installed.

This has been updated recently and should be more stable however it should still be considered an example / proof of concept. It is not complete and it will have substantial changes in the future.

Please send feedback on any performance improvements that can be made for sound quality, stability, or efficiency.

Usage Example

See example folder

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KillPlayer

func KillPlayer()

KillPlayer forces the player to stop by killing the ffmpeg cmd process this method may be removed later in favor of using chans or bools to request a stop.

func PlayAudioFile

func PlayAudioFile(v *discordgo.VoiceConnection, filename string)

PlayAudioFile will play the given filename to the already connected Discord voice server/channel. voice websocket and udp socket must already be setup before this will work.

func ReceivePCM

func ReceivePCM(v *discordgo.VoiceConnection, c chan *discordgo.Packet)

ReceivePCM will receive on the the Discordgo OpusRecv channel and decode the opus audio into PCM then send it on the provided channel.

func SendPCM

func SendPCM(v *discordgo.VoiceConnection, pcm <-chan []int16)

SendPCM will receive on the provied channel encode received PCM data into Opus then send that to Discordgo

Types

This section is empty.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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