Codota Logo
AudioFormat.computeDuration
Code IndexAdd Codota to your IDE (free)

How to use
computeDuration
method
in
javax.media.format.AudioFormat

Best Java code snippets using javax.media.format.AudioFormat.computeDuration (Showing top 3 results out of 315)

  • Common ways to obtain AudioFormat
private void myMethod () {
AudioFormat a =
  • Codota IconString str;new AudioFormat(str)
  • Codota IconString str;new AudioFormat(str, double1, int1, int2)
  • Smart code suggestions by Codota
}
origin: jitsi/jigasi

/**
 * Get the length of the audio in this {@link TranscriptionRequest} in
 * milliseconds
 *
 * @return the duration of the audio in milliseconds or -1 when unknown
 */
public long getDurationInMs()
{
  if(this.format == null)
  {
    return -1;
  }
  return TimeUnit.NANOSECONDS.toMillis(
    this.format.computeDuration(this.audio.length));
}
origin: jitsi/libjitsi

/**
 * Gets the length in milliseconds of the media in a specific
 * <tt>Buffer</tt> (often referred to as duration).
 *
 * @param buffer the <tt>Buffer</tt> which contains media the length in
 * milliseconds of which is to be calculated
 * @return the length in milliseconds of the media in <tt>buffer</tt> if
 * there actually is media in <tt>buffer</tt> and its length in milliseconds
 * can be calculated; otherwise, <tt>0</tt>
 */
private long getLengthInMillis(Buffer buffer)
{
  int length = buffer.getLength();
  if (length < 1)
    return 0;
  Format format = buffer.getFormat();
  if (format == null)
  {
    format = getFormat();
    if (format == null)
      return 0;
  }
  if (!(format instanceof AudioFormat))
    return 0;
  AudioFormat audioFormat = (AudioFormat) format;
  long duration = audioFormat.computeDuration(length);
  return (duration < 1) ? 0 : (duration / 1000000);
}
origin: jitsi/libjitsi

= (audioStreamFormat.computeDuration(audioStreamLength)
    + 999999)
  / 1000000;
javax.media.formatAudioFormatcomputeDuration

Popular methods of AudioFormat

  • <init>
  • getSampleRate
  • getChannels
  • getEncoding
  • getSampleSizeInBits
  • getDataType
  • getEndian
  • getFrameRate
  • getFrameSizeInBits
  • getSigned
  • intersects
  • matches
  • intersects,
  • matches

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ImageIO (javax.imageio)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now