Documentation
¶
Overview ¶
Package vgm plays VGM and VGZ files, register logs of arcade, console and computer sound chips, by emulating the chips with cores from libvgm and emu2413. The command interpreter, DAC stream engine, data block handling, resampling and mixing are our own. A Decoder is a beep StreamSeekCloser; it is not safe for concurrent use.
Index ¶
Constants ¶
const (
// MaxFileBytes caps a VGM file, and a VGZ file after decompression.
MaxFileBytes = 64 << 20
)
Variables ¶
var ( // ErrClosed is returned by Seek on a closed Decoder. ErrClosed = errors.New("vgm: decoder closed") )
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder renders a VGM file as a stereo stream. It is not safe for concurrent use.
func OpenBytes ¶
OpenBytes decodes a VGM or VGZ file held in memory. The Decoder keeps its own copy of uncompressed data.
func (*Decoder) SampleRate ¶
SampleRate is the output rate in Hz.
type Info ¶
type Info struct {
Title string // track title
Game string
System string
Author string
Date string // release date as written in the tag
Year string // first four-digit year in Date, if any
Notes string
TrackTitle string // same as Title
}
Info is the GD3 tag of a VGM file. English fields are preferred and the Japanese ones fill in when the English one is empty.
type Options ¶
type Options struct {
// SampleRate is the output rate in Hz; 0 means 48000.
SampleRate int
// Loops is how many times a looping file plays its loop; 0 means 2.
// The header's loop modifier and loop base adjust it.
Loops int
// FadeSeconds is the fade-out after the last loop; 0 means 8.
FadeSeconds float64
// AccurateYM2612 uses the Nuked OPN2 core for the YM2612 and YM3438.
// It is closer to the hardware and several times slower.
AccurateYM2612 bool
}
Options configures a Decoder. Zero values select the defaults.