I don't think anyone does anything as complicated as you are trying to do(*).
Some emulators calculate the real sample rate because some sound cards aren't that accurate ( or the timing they compare against aren't ).
If your cpu isn't fast enough to keep up then something bad is going to happen, there are no easy wins. The crackling is a reminder to go out and buy a faster computer. You're better off profiling your code and optimising the hot spots, if you're aiming for lower processor requirements.
smf (*) I think advance may have done and it sounded terrible, everything went out of tune.
|