minimp3

package module
v0.0.0-...-7ea857e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 6 Imported by: 0

README

go-minimp3

Originally https://github.com/tosone/minimp3.

tosone/minimp3 is MIT licensed, minimp3 itself is PD.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferSize = 1024 * 10

BufferSize Decoded data buffer size.

View Source
var WaitForDataDuration = time.Millisecond * 10

WaitForDataDuration wait for the data time duration.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	SampleRate int
	Channels   int
	Kbps       int
	Layer      int
	// contains filtered or unexported fields
}

Decoder decode the mp3 stream by minimp3

func DecodeFull

func DecodeFull(mp3 []byte) (dec *Decoder, decodedData []byte, err error)

DecodeFull put all of the mp3 data to decode.

func NewDecoder

func NewDecoder(reader io.Reader) (dec *Decoder, err error)

NewDecoder decode mp3 stream and get a Decoder for read the raw data to play.

func (*Decoder) Close

func (dec *Decoder) Close()

Close stop the decode mp3 stream cycle.

func (*Decoder) Read

func (dec *Decoder) Read(data []byte) (n int, err error)

Read read the raw stream

func (*Decoder) Started

func (dec *Decoder) Started() (channel chan bool)

Started check the record mp3 stream started ot not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL