streamdecoder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedReadSeeker

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

BufferedReadSeeker represents a buffered seekable buffer which allows io.ReadCloser to be seeked. BufferedReadSeeker will read the stream as needed and keep it in memory until closed and does not support io.SeekEnd

func (*BufferedReadSeeker) Close

func (s *BufferedReadSeeker) Close() (err error)

Close closes the underlying ReadCloser

func (*BufferedReadSeeker) Read

func (s *BufferedReadSeeker) Read(p []byte) (n int, err error)

func (*BufferedReadSeeker) Seek

func (s *BufferedReadSeeker) Seek(offset int64, whence int) (npos int64, err error)

Seek seeks BufferedReadSeeker to the provided location, io.SeekEnd is not supported

type MP3Decoder

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

MP3Decoder represents a mp3 decoding stream

func NewMP3Decoder

func NewMP3Decoder(stream io.ReadCloser) (decoder *MP3Decoder, err error)

NewMP3Decoder returns a 16bit/48khz PCM stream with provided mp3 stream

func (*MP3Decoder) Close

func (decoder *MP3Decoder) Close() (err error)

Close closes the mp3 stream and the underlying stream

func (*MP3Decoder) Read

func (decoder *MP3Decoder) Read(p []byte) (n int, err error)

type OpusDecoder

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

OpusDecoder represents a opus decoding stream

func NewOpusDecoder

func NewOpusDecoder(stream io.Reader, sampleRate, channels int) (decoder *OpusDecoder, err error)

NewOpusDecoder returns a new 16bit/48khz PCM stream with the provided opus stream

func (*OpusDecoder) Close

func (decoder *OpusDecoder) Close() (err error)

Close closes the opus decoding stream and the underlying stream

func (*OpusDecoder) Read

func (decoder *OpusDecoder) Read(p []byte) (n int, err error)

type VorbisDecoder

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

VorbisDecoder represents a vorbis decoding stream

func NewVorbisDecoder

func NewVorbisDecoder(stream io.ReadCloser) (decoder *VorbisDecoder, err error)

NewVorbisDecoder returns a 16bit/48khz PCM stream with provided vorbis stream

func (*VorbisDecoder) Close

func (decoder *VorbisDecoder) Close() (err error)

Close closes the Vorbis stream and the underlying stream

func (*VorbisDecoder) Read

func (decoder *VorbisDecoder) Read(p []byte) (n int, err error)

type WebMDecoder

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

WebMDecoder represents a WebM decoding stream.

BUG(TrungNguyen1909): The WebMDecoder will buffer the whole stream until close because webm requires a seekable stream.

func NewWebMDecoder

func NewWebMDecoder(stream io.ReadCloser) (decoder *WebMDecoder, err error)

NewWebMDecoder returns a new 16bit/48khz PCM audio stream with the provided WebM stream

BUG(TrungNguyen1909): Only WebM stream with opus audio is supported.

func (*WebMDecoder) Close

func (decoder *WebMDecoder) Close() (err error)

Close closes the webm decoding stream and the underlying stream

func (*WebMDecoder) Read

func (decoder *WebMDecoder) Read(p []byte) (n int, err error)

Notes

Bugs

  • The WebMDecoder will buffer the whole stream until close because webm requires a seekable stream.

  • Only WebM stream with opus audio is supported.

Jump to

Keyboard shortcuts

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