Java examples for java.lang:float
Gets the number of samples in a frame of the given length in milliseconds and the given sample rate.
//package com.java2s; public class Main { /**//from w w w. jav a 2s . c o m * Gets the number of samples in a frame of the given length in milliseconds and the given sample rate. * @param msPerFrame * @param sampleRate * @return */ public static int getFrameSize(int msPerFrame, int sampleRate) { float seconds = (float) msPerFrame / 1000; return (int) (seconds * sampleRate); } }