moved sampleRate to constructor