Fixes (do not change it back)

I fixed a lot of bugs, whitch you created. You using a lot of doubles
(instead of int) where it is not seccesury, please convert some doubles
into integers if micro accuracy is not neccesury. And, please, don'
change my method imitateSound