codecs

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeOpusAudio added in v0.1.2

func DecodeOpusAudio(data []byte, sampleRate int, numChannels int) (*model.AudioFrame, error)

Types

type AudioStreamDecoder

type AudioStreamDecoder interface {
	Push(data []byte)
	EndInput()
	Next() (*model.AudioFrame, error)
	Close() error
}

AudioStreamDecoder is a generic interface for decoding compressed audio formats (like MP3, WAV, FLAC) into raw PCM AudioFrames suitable for LiveKit WebRTC output.

func NewAACAudioStreamDecoder added in v0.1.3

func NewAACAudioStreamDecoder() AudioStreamDecoder

func NewFFmpegAudioStreamDecoder added in v0.1.3

func NewFFmpegAudioStreamDecoder(inputFormat string, sampleRate int, numChannels int) AudioStreamDecoder

func NewFLACAudioStreamDecoder added in v0.1.3

func NewFLACAudioStreamDecoder() AudioStreamDecoder

func NewMP3AudioStreamDecoder

func NewMP3AudioStreamDecoder() AudioStreamDecoder

func NewOpusAudioStreamDecoder added in v0.1.2

func NewOpusAudioStreamDecoder(sampleRate int, numChannels int) AudioStreamDecoder

func NewPCMAudioStreamDecoder

func NewPCMAudioStreamDecoder(sampleRate int, numChannels int) AudioStreamDecoder

type DecoderType

type DecoderType string
const (
	DecoderTypePCM  DecoderType = "pcm"
	DecoderTypeMP3  DecoderType = "mp3"
	DecoderTypeOpus DecoderType = "opus"
)

type FFmpegAudioStreamDecoder added in v0.1.3

type FFmpegAudioStreamDecoder struct {
	// contains filtered or unexported fields
}

func (*FFmpegAudioStreamDecoder) Close added in v0.1.3

func (d *FFmpegAudioStreamDecoder) Close() error

func (*FFmpegAudioStreamDecoder) EndInput added in v0.1.3

func (d *FFmpegAudioStreamDecoder) EndInput()

func (*FFmpegAudioStreamDecoder) Next added in v0.1.3

func (*FFmpegAudioStreamDecoder) Push added in v0.1.3

func (d *FFmpegAudioStreamDecoder) Push(data []byte)

type MP3AudioStreamDecoder

type MP3AudioStreamDecoder struct {
	// contains filtered or unexported fields
}

func (*MP3AudioStreamDecoder) Close

func (d *MP3AudioStreamDecoder) Close() error

func (*MP3AudioStreamDecoder) EndInput

func (d *MP3AudioStreamDecoder) EndInput()

func (*MP3AudioStreamDecoder) Next

func (*MP3AudioStreamDecoder) Push

func (d *MP3AudioStreamDecoder) Push(data []byte)

type OpusAudioStreamDecoder added in v0.1.2

type OpusAudioStreamDecoder struct {
	// contains filtered or unexported fields
}

func (*OpusAudioStreamDecoder) Close added in v0.1.2

func (d *OpusAudioStreamDecoder) Close() error

func (*OpusAudioStreamDecoder) EndInput added in v0.1.2

func (d *OpusAudioStreamDecoder) EndInput()

func (*OpusAudioStreamDecoder) Next added in v0.1.2

func (*OpusAudioStreamDecoder) Push added in v0.1.2

func (d *OpusAudioStreamDecoder) Push(data []byte)

type PCMAudioStreamDecoder

type PCMAudioStreamDecoder struct {
	// contains filtered or unexported fields
}

PCMAudioStreamDecoder implements AudioStreamDecoder for raw PCM streams

func (*PCMAudioStreamDecoder) Close

func (d *PCMAudioStreamDecoder) Close() error

func (*PCMAudioStreamDecoder) EndInput

func (d *PCMAudioStreamDecoder) EndInput()

func (*PCMAudioStreamDecoder) Next

func (*PCMAudioStreamDecoder) Push

func (d *PCMAudioStreamDecoder) Push(data []byte)

Jump to

Keyboard shortcuts

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