I've been trying to solve why my emulator has this issue with sound which causing the whole emulator to end up paused for a split second. I tracked this down to the emulator is waiting to load the audio buffer, but it can't because the audio is still playing.
I didn't understand why that would be till I looked at how many samples are available each frame. At 44100hz, sometimes 734 samples are available. Other times it is the desired 735 ( 44100 / 60 = 735). I'm using Blargg's NES APU library, and my emulator uses Allegro.
I want to sync to 60hz, via Vsync. If I can't do that, the emulator's drawing is not smooth at all. So is there a way to adjust so that I get 735 samples per second every single frame, all the time. I don't care if the sound gets somewhat off pitch as that is less important to me than the video being smooth.
I've read things suggestions that underclocking the APU might help and other things. If anyone has a good idea or any idea let me know. I've been battling this thing for awhile. The default APU frequency is 1789773. Again I'm using Allegro.
I didn't understand why that would be till I looked at how many samples are available each frame. At 44100hz, sometimes 734 samples are available. Other times it is the desired 735 ( 44100 / 60 = 735). I'm using Blargg's NES APU library, and my emulator uses Allegro.
I want to sync to 60hz, via Vsync. If I can't do that, the emulator's drawing is not smooth at all. So is there a way to adjust so that I get 735 samples per second every single frame, all the time. I don't care if the sound gets somewhat off pitch as that is less important to me than the video being smooth.
I've read things suggestions that underclocking the APU might help and other things. If anyone has a good idea or any idea let me know. I've been battling this thing for awhile. The default APU frequency is 1789773. Again I'm using Allegro.