private static float calculateDuration ( int layer , int sampleRate ) { int sampleCount = ( layer == AudioFrame . LAYER_1 ) ? SAMPLE_COUNT_L1 : SAMPLE_COUNT_L2 ; return ( 1000.0f / sampleRate ) * sampleCount ; }
Calculates the duration of a MPEG frame based on the given parameters .