oggreader

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 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.Reader) (*OggReader, *OggHeader, error)

NewWith returns a new Ogg reader and Ogg header with an io.Reader 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.Reader)

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