Enum Class SoundFormat

java.lang.Object
java.lang.Enum<SoundFormat>
pi.resources.sound.SoundFormat
All Implemented Interfaces:
Serializable, Comparable<SoundFormat>, Constable

public enum SoundFormat extends Enum<SoundFormat>
Contains all known audio file-formats supported by the engine.
Author:
Steffen Wilke, Matthias Wilke
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static SoundFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SoundFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public static SoundFormat get(String format)
      Gets the SoundFormat of the specified format string.
      Parameters:
      format - The format string from which to extract the format.
      Returns:
      The format of the specified string or UNDEFINED if not supported.
    • isSupported

      public static boolean isSupported(File file)
      Determines whether the extension of the specified file is supported by the engine.
      Parameters:
      file - The file to check for.
      Returns:
      True if the extension is part of this enum; otherwise false.
    • isSupported

      public static boolean isSupported(String fileName)
      Determines whether the extension of the specified file is supported by the engine.
      Parameters:
      fileName - The file name to check for.
      Returns:
      True if the extension is part of this enum; otherwise false.
    • getAllExtensions

      public static String[] getAllExtensions()
    • toFileExtension

      public String toFileExtension()
      Converts this format instance to a file format string that can be used as an extension (e.g. .ogg).
      It adds a leading '.' to the lower-case string representation of this instance.
      Returns:
      The file extension string for this instance.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SoundFormat>