Versions in this module Expand all Collapse all v0 v0.3.1 Apr 12, 2024 v0.3.0 Apr 12, 2024 v0.2.2 Oct 28, 2022 v0.2.1 Oct 28, 2022 v0.2.0 Oct 25, 2022 Changes in this version type Audio + func (a *Audio) Reader() io.Reader + type AudioFormat int + const AudioF32 + const AudioF32N + const AudioF32NLR + const AudioS16 type MPEG + func (m *MPEG) AudioFormat() AudioFormat + func (m *MPEG) SetAudioFormat(format AudioFormat) type Samples + F32 []float32 + S16 []int16 + type SamplesReader struct + func (s *SamplesReader) Read(b []byte) (int, error) + func (s *SamplesReader) Seek(offset int64, whence int) (int64, error) v0.1.0 Oct 23, 2022 Changes in this version + const PacketAudio1 + const PacketAudio2 + const PacketAudio3 + const PacketAudio4 + const PacketInvalidTS + const PacketPrivate + const PacketVideo1 + const SamplesPerFrame + var BufferSize = 128 * 1024 + var ErrInvalidHeader = errors.New("invalid MPEG-PS header") + var ErrInvalidMPEG = errors.New("invalid MPEG-PS") + type Audio struct + func NewAudio(buf *Buffer) *Audio + func (a *Audio) Buffer() *Buffer + func (a *Audio) Channels() int + func (a *Audio) Decode() *Samples + func (a *Audio) HasEnded() bool + func (a *Audio) HasHeader() bool + func (a *Audio) Rewind() + func (a *Audio) Samplerate() int + func (a *Audio) SetTime(time float64) + func (a *Audio) Time() float64 + type AudioFunc func(mpeg *MPEG, samples *Samples) + type Buffer struct + func NewBuffer(r io.Reader) (*Buffer, error) + func (b *Buffer) Bytes() []byte + func (b *Buffer) HasEnded() bool + func (b *Buffer) Index() int + func (b *Buffer) LoadReaderCallback(buffer *Buffer) + func (b *Buffer) Remaining() int + func (b *Buffer) Rewind() + func (b *Buffer) Seekable() bool + func (b *Buffer) SetLoadCallback(callback LoadFunc) + func (b *Buffer) SignalEnd() + func (b *Buffer) Size() int + func (b *Buffer) Write(p []byte) int + type Demux struct + func NewDemux(buf *Buffer) (*Demux, error) + func (d *Demux) Buffer() *Buffer + func (d *Demux) Decode() *Packet + func (d *Demux) Duration(typ int) float64 + func (d *Demux) HasEnded() bool + func (d *Demux) HasHeaders() bool + func (d *Demux) NumAudioStreams() int + func (d *Demux) NumVideoStreams() int + func (d *Demux) Rewind() + func (d *Demux) Seek(seekTime float64, typ int, forceIntra bool) *Packet + func (d *Demux) StartTime(typ int) float64 + type Frame struct + Cb Plane + Cr Plane + Height int + Time float64 + Width int + Y Plane + func (f *Frame) Pixels() []color.RGBA + func (f *Frame) RGBA() *image.RGBA + func (f *Frame) YCbCr() *image.YCbCr + type LoadFunc func(buffer *Buffer) + type MPEG struct + func New(r io.Reader) (*MPEG, error) + func (m *MPEG) Audio() *Audio + func (m *MPEG) AudioEnabled() bool + func (m *MPEG) AudioLeadTime() float64 + func (m *MPEG) Channels() int + func (m *MPEG) Decode(tick float64) + func (m *MPEG) DecodeAudio() *Samples + func (m *MPEG) DecodeVideo() *Frame + func (m *MPEG) Done() chan bool + func (m *MPEG) Duration() time.Duration + func (m *MPEG) Framerate() float64 + func (m *MPEG) HasEnded() bool + func (m *MPEG) HasHeaders() bool + func (m *MPEG) Height() int + func (m *MPEG) Loop() bool + func (m *MPEG) NumAudioStreams() int + func (m *MPEG) NumVideoStreams() int + func (m *MPEG) Rewind() + func (m *MPEG) Samplerate() int + func (m *MPEG) Seek(time float64, seekExact bool) bool + func (m *MPEG) SeekFrame(time float64, seekExact bool) *Frame + func (m *MPEG) SetAudioCallback(callback AudioFunc) + func (m *MPEG) SetAudioEnabled(enabled bool) + func (m *MPEG) SetAudioLeadTime(leadTime float64) + func (m *MPEG) SetAudioStream(streamIndex int) + func (m *MPEG) SetLoop(loop bool) + func (m *MPEG) SetVideoCallback(callback VideoFunc) + func (m *MPEG) SetVideoEnabled(enabled bool) + func (m *MPEG) Time() float64 + func (m *MPEG) Video() *Video + func (m *MPEG) VideoEnabled() bool + func (m *MPEG) Width() int + type Packet struct + Data []byte + Pts float64 + Type int + type Plane struct + Data []byte + Height int + Width int + type Samples struct + Interleaved []float32 + Left []float32 + Right []float32 + Time float64 + func (s *Samples) Bytes() []byte + type Video struct + func NewVideo(buf *Buffer) *Video + func (v *Video) Buffer() *Buffer + func (v *Video) Decode() *Frame + func (v *Video) Framerate() float64 + func (v *Video) HasEnded() bool + func (v *Video) HasHeader() bool + func (v *Video) Height() int + func (v *Video) Rewind() + func (v *Video) SetNoDelay(noDelay bool) + func (v *Video) SetTime(time float64) + func (v *Video) Time() float64 + func (v *Video) Width() int + type VideoFunc func(mpeg *MPEG, frame *Frame)