Here you can find the source of samplesToMilliseconds(int sampleRate, int samples)
samples
are with sampleRate
.
Parameter | Description |
---|---|
sampleRate | The sample rate. |
samples | The number of samples. |
public static int samplesToMilliseconds(int sampleRate, int samples)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . ja va 2 s .co m * Calculates how many milliseconds <code>samples</code> are with * <code>sampleRate</code>. * * @param sampleRate The sample rate. * @param samples The number of samples. * @return Samples in milliseconds. */ public static int samplesToMilliseconds(int sampleRate, int samples) { return Math.round((float) samples / sampleRate * 1000); } }