Documentation ¶
Overview ¶
Package nsf provides reading and emulating of Nintendo NSF sound files.
Testing ¶
PortAudio is the current default for audio output.
To install PortAudio on Mac OSX:
brew install portaudio
To install PortAudio on Ubuntu:
sudo apt-get install portaudio19-dev
Then play with go test. The track can be changed by incrementing the parameter in the n.Init() call in nsf_test.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultSampleRate is the default sample rate of a track after calling // Init(). DefaultSampleRate int64 = 44100 DefaultDuration = time.Minute * 2 DefaultFade = time.Second * 2 DefaultSilence = time.Second * 2 )
View Source
var ErrUnrecognized = errors.New("nsf: unrecognized format")
Functions ¶
This section is empty.
Types ¶
type NSF ¶
type NSF struct { *cpu6502.Cpu // Silence is the duration for which if the result of Play is silence, // Play will halt. Set to 0 to disable silence check. Silence time.Duration // SampleRate is the sample rate at which samples will be generated. If not // set before Init(), it is set to DefaultSampleRate. SampleRate int64 // Start is the 0-based index of the starting song Start byte Songs []Song Copyright string Artist string Game string LoadAddr uint16 InitAddr uint16 PlayAddr uint16 SpeedNTSC uint16 Bankswitch [8]byte Data []byte // contains filtered or unexported fields }
func (*NSF) Init ¶
Init initializes the 1-based song for playing. Only one song my play at once. An invalid song index will play the first song.
Click to show internal directories.
Click to hide internal directories.