Documentation ¶
Overview ¶
Package vorbis provides Ogg/Vorbis decoder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is a decoded audio stream.
func Decode
deprecated
Decode decodes Ogg/Vorbis data to playable stream in signed 16bit integer, little endian, 2 channels (stereo) format.
Decode returns error when decoding fails or IO error happens.
Decode automatically resamples the stream to fit with the audio context if necessary.
The returned Stream's Seek is available only when src is an io.Seeker.
A Stream doesn't close src even if src implements io.Closer. Closing the source is src owner's responsibility.
Deprecated: as of v2.1. Use DecodeWithSampleRate instead.
func DecodeF32 ¶ added in v2.8.0
DecodeF32 decodes Ogg/Vorbis data to playable stream in 32bit float, little endian, 2 channels (stereo) format.
DecodeF32 returns error when decoding fails or IO error happens.
The returned Stream's Seek is available only when src is an io.Seeker.
A Stream doesn't close src even if src implements io.Closer. Closing the source is src owner's responsibility.
func DecodeWithSampleRate ¶ added in v2.1.0
DecodeWithSampleRate decodes Ogg/Vorbis data to playable stream in signed 16bit integer, little endian, 2 channels (stereo) format.
DecodeWithSampleRate returns error when decoding fails or IO error happens.
DecodeWithSampleRate automatically resamples the stream to fit with sampleRate if necessary.
The returned Stream's Seek is available only when src is an io.Seeker.
A Stream doesn't close src even if src implements io.Closer. Closing the source is src owner's responsibility.
Resampling can be a very heavy task. Stream has a cache for resampling, but the size is limited. Do not expect that Stream has a resampling cache even after whole data is played.
func DecodeWithoutResampling ¶ added in v2.4.0
DecodeWithoutResampling decodes Ogg/Vorbis data to playable stream in signed 16bit integer, little endian, 2 channels (stereo) format.
DecodeWithoutResampling returns error when decoding fails or IO error happens.
The returned Stream's Seek is available only when src is an io.Seeker.
A Stream doesn't close src even if src implements io.Closer. Closing the source is src owner's responsibility.
func (*Stream) Length ¶
Length returns the size of decoded stream in bytes.
If the source is not io.Seeker, Length returns 0.
func (*Stream) SampleRate ¶ added in v2.8.0
SampleRate returns the sample rate of the decoded stream.