function y=msToSamples(x,sampleRate)
y=floor(x*sampleRate/1000);