audio

package
v0.0.0-...-2af7037 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//FrameSize is the preset frame size for each audio data
	FrameSize = 1920
	//SampleRate is the preset sample rate for each audio data
	SampleRate = 48000

	//FrameDuration is the duration of audio data in each frame
	FrameDuration = time.Second * FrameSize / SampleRate
)

Variables

This section is empty.

Functions

func CompressAudio

func CompressAudio(encoder *opus.Encoder, raw []float32) []byte

CompressAudio uses opus codec to compress raw MONO audio data

func DecompressAudio

func DecompressAudio(decoder *opus.Decoder, data []byte) ([]float32, error)

DecompressAudio uses opus codec to decompress opus data to raw MONO audio data

func NewDecoder

func NewDecoder() *opus.Decoder

NewDecoder creates a new Opus decoder

func NewEncoder

func NewEncoder() *opus.Encoder

NewEncoder creates a new Opus encoder

Types

This section is empty.

Jump to

Keyboard shortcuts

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