nwidger / nintengo

An NES emulator written in Go
GNU General Public License v2.0
1.3k stars 51 forks source link

nes: implement an APU debug audio backend. #2

Closed slimsag closed 9 years ago

slimsag commented 9 years ago

To use the debug backend build/install using the build tags "sdl" AND "apudebug". For example:

go build -tags "sdl apudebug"

It will print every second how many samples the APU has created, the total time that has passed, and the samples per second. On my old laptop for example:

APU DEBUG: Total samples: 106595 Total time: 3.000063835s 35530.910628 samples/sec

APU DEBUG: Total samples: 140324 Total time: 4.000065022s 35080.429750 samples/sec

APU DEBUG: Total samples: 170463 Total time: 5.000062647s 34092.172846 samples/sec

Where 34092.172846 samples/sec directly relates to e.g. 34khz audio.