mad

package module
v0.0.0-...-09f0ace Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2011 License: GPL-3.0 Imports: 4 Imported by: 0

README

NAME
    mad is a Go bindings for C mad (MPEG Audio Decoder) library.

AUTHORS
    Viacheslav Chumushuk <voice@root.ua>

COPYING
    This programm is released under the GNU General Public License version 3 or later, which is
    distributed in the COPYING file. You should have received a copy of the GNU General Public License along with
    this program.  If not, see <http://www.gnu.org/licenses/>.

Documentation

Overview

mad is MPEG Audio Decoder.

Index

Constants

View Source
const (
	// Set new position relative to the start.
	SeekSet = iota
	// Set new position related to the current one.
	SeekCurrent
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

File structure represents MP3 file.

func New

func New(filename string) (decoder *Decoder, err os.Error)

New opens and initialize MAD decoder and File structure.

func (*Decoder) Channels

func (decoder *Decoder) Channels() int

Channels returns number of channels for the related audio file.

func (*Decoder) Close

func (decoder *Decoder) Close()

Close release resources assigned to Decoder structure and close MAD decoder.

func (*Decoder) CurrentPosition

func (decoder *Decoder) CurrentPosition() int

CurrentPosition returns current decoding position, in seconds.

func (*Decoder) Length

func (decoder *Decoder) Length() int

Length returns file's length in seconds.

func (*Decoder) Read

func (decoder *Decoder) Read(buf []byte) int

Read returns up to the specified number of bytes of decoded PCM audio. Return number of read 16-bit words.

func (*Decoder) SampleRate

func (decoder *Decoder) SampleRate() int

SampleRate returns file's sample rate value.

func (*Decoder) Seek

func (decoder *Decoder) Seek(position int, whence Whence) os.Error

Seek move decoding position. If whence parameter is SeekSet than position parameter should be non-negative integer value, which is new decoding position relative to the start of the file. If whence equals SeekCurrent than position parameter can be negative as well as positive integer, which means new position related to the current one.

type Whence

type Whence int

Whence type for Seek function.

Jump to

Keyboard shortcuts

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