small optimizations to sound engine