protected long scaleTime(int reqSampleRate,long targetTimeInSamples){
  if (reqSampleRate == sampleRate)   return (targetTimeInSamples);
  return (Math.round((double)(reqSampleRate) * (double)(targetTimeInSamples) / (sampleRate)));
}

protected long scaleTime ( int reqSampleRate , long targetTimeInSamples ) { if ( reqSampleRate == sampleRate ) return ( targetTimeInSamples ) ; return ( Math . round ( ( double ) ( reqSampleRate ) * ( double ) ( targetTimeInSamples ) / ( sampleRate ) ) ) ; }
scales a discrete time to the timeline ' s sample rate .
