Class AudioUtil


  • public class AudioUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AudioUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.sound.sampled.Clip getClip​(java.io.File file)
      Returns the clip of the given audio file.
      static long getDuration​(java.io.File file)
      Returns the duration of the audio file in millisecond.
      static java.util.Map<java.lang.String,​java.lang.Object> getMetaData​(java.io.File file)
      Returns the meta data of the given audio file.
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AudioUtil

        public AudioUtil()
    • Method Detail

      • getMetaData

        public static java.util.Map<java.lang.String,​java.lang.Object> getMetaData​(java.io.File file)
        Returns the meta data of the given audio file.
        Parameters:
        file - the file to process
        Returns:
        a map of metadata
        Since:
        jcms-5.5.0
      • getDuration

        public static long getDuration​(java.io.File file)
        Returns the duration of the audio file in millisecond. From http://javaalmanac.com/egs/javax.sound.sampled/Duration.html
        Parameters:
        file - the file to process
        Returns:
        the duration in millisecond.
        Since:
        jcms-5.5.0
      • getClip

        public static javax.sound.sampled.Clip getClip​(java.io.File file)
        Returns the clip of the given audio file. Cut and Paste from http://javaalmanac.com/egs/javax.sound.sampled/Load.html
        Parameters:
        file - the file to process
        Returns:
        the clip of the given audio file
        Since:
        jcms-5.5.0
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception