congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AudioFormat.computeDuration
Code IndexAdd Tabnine 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)

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

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • String (java.lang)
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now