Skip to content
a native go ogg/vorbis decoder
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testdata
LICENSE
README.md Update readme Dec 3, 2017
crc.go import Nov 24, 2016
doc.go import Nov 24, 2016
go.mod Add go.mod Sep 9, 2018
go.sum
ogg.go
reader.go
reader_test.go
util.go Merge branch 'master' of https://github.com/jfreymuth/oggvorbis Dec 3, 2017

README.md

oggvorbis

a native go ogg/vorbis decoder

GoDoc

Usage

This package provides the type oggvorbis.Reader, which can be used to read .ogg files.

r, err := oggvorbis.NewReader(reader)
// handle error

fmt.Println(r.SampleRate())
fmt.Println(r.Channels())

buffer := make([]float32, 8192)
for {
	n, err := r.Read(buffer)

	// use buffer[:n]

	if err == io.EOF {
		break
	}
	if err != nil {
		// handle error
	}
}

The reader also provides methods for seeking, these will only work if the reader was created from an io.ReadSeeker.

There are also convenience functions to read an entire (small) file, similar to ioutil.ReadAll.

data, format, err := oggvorbis.ReadAll(reader)
You can’t perform that action at this time.