Documentation ¶
Overview ¶
Package audio implements the audio generation of the TIA. The implementation is taken almost directly from Ron Fries' original implementation, found in TIASound.c (easily searchable). The bit patterns are taken from there and the channels are mixed in the same way.
Unlike the Fries' implementation, the Step() function is called every video cycle, returning a new sample every 114th video clock. The TIA_Process() function in Frie's implementation meanwhile is called to fill a buffer. The sample buffer in this emulation must sit outside of the TIA emulation.
TIASound.c is published under the GNU Library GPL v2.0 ¶
Some modifications were made to Fries' alogorithm in accordance to similar modifications made to the TIASnd.cxx file of the Stella emulator v5.1.3. Stella is published under the GNU GPL v2.0.
The audio package does not mix the sound from the two independent audio channels. For that, see the mix package.
Index ¶
Constants ¶
const SampleFreq = 31403
SampleFreq represents the number of samples generated per second. This is the 30Khz reference frequency desribed in the Stella Programmer's Guide.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct { // the volume output for each channel Vol0 uint8 Vol1 uint8 // contains filtered or unexported fields }
Audio is the implementation of the TIA audio sub-system, using Ron Fries' method. Reference source code here:
https://raw.githubusercontent.com/alekmaul/stella/master/emucore/TIASound.c
func NewAudio ¶
func NewAudio() *Audio
NewAudio is the preferred method of initialisation for the Audio sub-system.
func (*Audio) ReadMemRegisters ¶ added in v0.12.1
ReadMemRegisters checks the TIA memory for changes to registers that are interesting to the audio sub-system
Returns true if memory.ChipData has not been serviced.
func (*Audio) Snapshot ¶ added in v0.7.1
Snapshot creates a copy of the TIA Audio sub-system in its current state.