Documentation ¶
Overview ¶
Package voiceutil provides utilities to work with harmony voice connections. It contains adapters that do the conversion between PCM and Opus-encoded data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpusDecoder ¶
func OpusDecoder(conn *voice.Connection) (pcmOut chan []int16, free chan struct{})
OpusDecoder is an adapter that allows to read the incoming voice data on conn as PCM, sent through the returned channel.
Disconnecting the VoiceConnection will close the decoder and free any allocated resources. If the adapter is not needed anymore but the VoiceConnection is, the free returned channel can be closed to free those resources.
Only one OpusDecoder is meant to be used at once on the same voice connection.
func OpusEncoder ¶
func OpusEncoder(conn *voice.Connection) (pcmIn chan []int16, err error)
OpusEncoder is an adapter that allows to send a PCM signal through the returned channel, it will encode it with Opus and send it through the given Discord voice connection.
The returned channel must be closed when the adapter is not needed anymore in order to free allocated resources.
Only one OpusEncoder is meant to be used at once on the same voice connection.
Types ¶
This section is empty.