replace timing functions, spin wait in audio callback