ebiten: github.com/hajimehoshi/ebiten/audio/mp3 Index | Files

package mp3

import "github.com/hajimehoshi/ebiten/audio/mp3"

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.


Package Files


type Stream Uses

type Stream struct {
    // contains filtered or unexported fields

Stream is a decoded stream.

func Decode Uses

func Decode(context *audio.Context, src audio.ReadSeekCloser) (*Stream, error)

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.

Decode takes the ownership of src, and Stream's Close function closes src.

func (*Stream) Close Uses

func (s *Stream) Close() error

Close is implementation of io.Closer's Close.

func (*Stream) Length Uses

func (s *Stream) Length() int64

Length returns the size of decoded stream in bytes.

func (*Stream) Read Uses

func (s *Stream) Read(buf []byte) (int, error)

Read is implementation of io.Reader's Read.

func (*Stream) Seek Uses

func (s *Stream) Seek(offset int64, whence int) (int64, error)

Seek is implementation of io.Seeker's Seek.

func (*Stream) Size Uses

func (s *Stream) Size() int64

Size is deprecated as of 1.6.0-alpha. Use Length instead.

Package mp3 imports 5 packages (graph) and is imported by 7 packages. Updated 2019-10-30. Refresh now. Tools for package owners.