voiceutil

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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