Class SoundFileUtils


  • public class SoundFileUtils
    extends Object
    Defines the different permit extension file.
    Author:
    Alexandre Maillard, Dmitri Melnikov, Vincent Lucas
    • Constructor Detail

      • SoundFileUtils

        public SoundFileUtils()
    • Method Detail

      • isSoundFile

        public static boolean isSoundFile​(File f)
        Checks whether this file is a sound file.
        Parameters:
        f - File to check
        Returns:
        true if it's a sound file, false otherwise
      • isSoundFile

        public static boolean isSoundFile​(File f,
                                          String[] soundFormats)
        Checks whether this file is a sound file.
        Parameters:
        f - File to check
        soundFormats - The sound formats to restrict the file name extension. If soundFormats is null, then every sound format defined by SoundFileUtils is correct.
        Returns:
        true if it's a sound file conforming to the format given in parameters (if soundFormats is null, then every sound format defined by SoundFileUtils is correct), false otherwise.
      • getExtension

        public static String getExtension​(File f)
        Gets the file extension. TODO: There are at least 2 other methods like this scattered around the SC code, we should move them all to util package.
        Parameters:
        f - which wants the extension
        Returns:
        Return the extension as a String