Java tutorial
//package com.java2s; public class Main { public static long bytesToSamples(long bytes, int frameSize) { return Math.round((float) bytes / frameSize); } }