Documentation ¶
Overview ¶
Package mp3 provides MP3 decoder.
On desktops and mobiles, a pure Go decoder is used. On browsers, a native decoder on the browser is used.
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 stream.
func Decode
deprecated
Decode decodes MP3 source and returns a decoded stream.
Decode returns error when decoding fails or IO error happens.
Decode automatically resamples the stream to fit with the audio context if necessary.
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 DecodeWithSampleRate ¶ added in v2.1.0
func DecodeWithSampleRate(sampleRate int, src io.ReadSeeker) (*Stream, error)
DecodeWithSampleRate decodes MP3 source and returns a decoded stream.
DecodeWithSampleRate returns error when decoding fails or IO error happens.
DecodeWithSampleRate automatically resamples the stream to fit with sampleRate if necessary.
A Stream doesn't close src even if src implements io.Closer. Closing the source is src owner's responsibility.