Memblers wrote:
That's what would happen if the audio buffer is too long, can you make it shorter? What system/library are you using for audio? I've only used SDL myself, but that info might allow someone else to help.
edit: PPU and audio synchronization seems to be a recurring problem with making an NES emulator, so there will surely be more to it than just using a shorter buffer. If you can find other threads about that, it might help.
I'm also using SDL... I can believe that my audio buffer is too long. Is this the "samples" member in SDL_AudioSpec as an argument to SDL_OpenAudioDevice? (
https://wiki.libsdl.org/SDL_OpenAudioDevice) I'm using 1600 here, which I calculated from:
4800hz * sizeof(short) / 30 / 2 (30 being arbitrary, in this case 30fps -- NTSC).
I stole that boilerplate calculation from some stackoverflow post so I may be off track here.