audio

package
v0.14.0 Latest Latest
Warning

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

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

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

View Source
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

func (au *Audio) ReadMemRegisters(data bus.ChipData) bool

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

func (au *Audio) Snapshot() *Audio

Snapshot creates a copy of the TIA Audio sub-system in its current state.

func (*Audio) Step added in v0.14.0

func (au *Audio) Step() bool

Step the audio on one TIA clock. The step will be filtered to produce a 30Khz clock.

func (*Audio) String

func (au *Audio) String() string

Directories

Path Synopsis
Package mix is used to combine two distinct sound sources into either a mono or stereo signal.
Package mix is used to combine two distinct sound sources into either a mono or stereo signal.

Jump to

Keyboard shortcuts

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