Java tutorial
//package com.java2s; public class Main { public static double samplesToMillis(long samples, int sampleRate) { return Math.round((float) samples / sampleRate * 1000); } }