Documentation ¶
Overview ¶
Package oggvorbis decodes audio from ogg/vorbis files.
Index ¶
- func GetCommentHeader(in io.Reader) (vorbis.CommentHeader, error)
- type Format
- type Reader
- func (r *Reader) Bitrate() vorbis.Bitrate
- func (r *Reader) Channels() int
- func (r *Reader) CommentHeader() vorbis.CommentHeader
- func (r *Reader) Length() int64
- func (r *Reader) Position() int64
- func (r *Reader) Read(p []float32) (int, error)
- func (r *Reader) SampleRate() int
- func (r *Reader) SetPosition(pos int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommentHeader ¶
func GetCommentHeader(in io.Reader) (vorbis.CommentHeader, error)
GetCommentHeader returns a struct containing info from the comment header.
Types ¶
type Format ¶
Format contains information about the audio format of an ogg/vorbis file.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
A Reader can read audio from an ogg/vorbis file.
func NewReader ¶
NewReader creates a new Reader. Some of the returned reader's methods will only work if in also implements io.Seeker
func (*Reader) CommentHeader ¶
func (r *Reader) CommentHeader() vorbis.CommentHeader
CommentHeader returns a struct containing info from the comment header.
func (*Reader) Length ¶
Length returns the length of the audio data in samples. A return value of zero means the length is unknown, probably because the underlying reader is not seekable.
func (*Reader) Read ¶
Read reads and decodes audio data and stores the result in p.
It returns the number of values decoded (number of samples * channels) and any error encountered, similarly to an io.Reader's Read method.
The number of values produced will always be a multiple of Channels().
func (*Reader) SampleRate ¶
SampleRate returns the sample rate of the vorbis stream.
func (*Reader) SetPosition ¶
SetPosition seeks to a position in samples. It will return an error if the underlying reader is not seekable.