Documentation ¶
Overview ¶
Package oggvorbis decodes audio from ogg/vorbis files.
Index ¶
- func Clear(f *OVFile) error
- func GetCommentHeader(in io.Reader) (vorbis.CommentHeader, error)
- func Info(f *OVFile, info *VorbisInfo) error
- func PcmSeek(f *OVFile, pos int64) error
- func PcmTotal(f *OVFile) (int64, error)
- func Read(f *OVFile, buffer unsafe.Pointer, nrBytes int) (int, int, error)
- func Seekable() bool
- func TimeTell() (float64, error)
- func TimeTotal() (float64, error)
- type Format
- type OVFile
- 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
- type VorbisInfo
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.
func Info ¶
func Info(f *OVFile, info *VorbisInfo) error
Info updates the specified VorbisInfo structure with contains basic information about the audio in a vorbis stream
func PcmSeek ¶
Seek seeks to the offset specified (in number pcm samples) within the physical bitstream. This function only works for seekable streams. Updates everything needed within the decoder, so you can immediately call Read() and get data from the newly seeked to position.
func PcmTotal ¶
PcmTotal returns the total number of pcm samples of the physical bitstream or a specified logical bit stream. To retrieve the total pcm samples for the entire physical bitstream, the 'link' parameter should be set to -1
func Read ¶
Read decodes next data from the file updating the specified buffer contents and returns the number of bytes read, the number of current logical bitstream and an error
func Seekable ¶
func Seekable() bool
Seekable returns indication whether or not the bitstream is seekable
Types ¶
type Format ¶
Format contains information about the audio format of an ogg/vorbis file.
type OVFile ¶
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.