Skip to content
sdobzPublic

About

mpg123 bindings for golang

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Go bindings for the mpg123 mp3 decoding library

These bingings were heavily influenced by weberc2's work

Usage:

First init the library

mpg123.Initialize()

Open a file and check the error

mp3, err := mpg123.Open("example.mp3")
if err != nil {
	panic(err)
}

errors are passed verbatim from mpg123

Get the format

rate, channels, encoding, format := mp3.Format()
fmt.Printf("Rate: %i Channels: %i Encoding: %i Format: %s\n", rate, channels, encoding, format)

format is compatible with audio.Format consts

Read 100 bytes of mp3 data into a buffer

data := make([]byte, 100)
err := mp3.Read(data)

mp3 conforms to the io.Reader, io.Seeker, io.Closer interfaces, though seeking is not yet implemented.

This means it can be used quite handily with the go audio library.

About

mpg123 bindings for golang

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages