oggreader

package
v2.2.27-0...-5dabb11 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package oggreader implements the Ogg media container reader

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWith

func NewWith(in io.ReadSeeker) (*OggReader, *OggHeader, error)

NewWith returns a new Ogg reader and Ogg header with an io.ReadSeeker input

Types

type OggHeader

type OggHeader struct {
	ChannelMap uint8
	Channels   uint8
	OutputGain uint16
	PreSkip    uint16
	SampleRate uint32
	Version    uint8
}

OggHeader is the metadata from the first two pages in the file (ID and Comment)

https://tools.ietf.org/html/rfc7845.html#section-3

type OggPageHeader

type OggPageHeader struct {
	GranulePosition uint64
	// contains filtered or unexported fields
}

OggPageHeader is the metadata for a Page Pages are the fundamental unit of multiplexing in an Ogg stream

https://tools.ietf.org/html/rfc7845.html#section-1

type OggReader

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

OggReader is used to read Ogg files and return page payloads

func (*OggReader) ParseNextPage

func (o *OggReader) ParseNextPage() ([]byte, *OggPageHeader, error)

ParseNextPage reads from stream and returns Ogg page payload, header, and an error if there is incomplete page data.

func (*OggReader) ResetReader

func (o *OggReader) ResetReader(reset func(bytesRead int64) io.ReadSeeker)

ResetReader resets the internal stream of OggReader. This is useful for live streams, where the end of the file might be read without the data being finished.

Jump to

Keyboard shortcuts

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