Fixed bug in sample rate function. It now retains length of file