Enum Class SoundFileType

java.lang.Object
java.lang.Enum<SoundFileType>
de.pottgames.tuningfork.SoundFileType
All Implemented Interfaces:
Serializable, Comparable<SoundFileType>, Constable

public enum SoundFileType extends Enum<SoundFileType>
  • Enum Constant Details

  • Method Details

    • values

      public static SoundFileType[] 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 SoundFileType 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
    • getByFileEnding

      public static SoundFileType getByFileEnding(String fileExtension)
      Retrieves a SoundFileType enum based on the provided file extension.
      Parameters:
      fileExtension - The file extension to be used for determining the SoundFileType.
      Returns:
      A SoundFileType enum representing the type of audio file associated with the given extension, or null if no matching type is found.
    • parseFromFile

      public static SoundFileType parseFromFile(com.badlogic.gdx.files.FileHandle file) throws IOException
      Parses a sound file type from the provided FileHandle by examining its header data.
      Parameters:
      file - The FileHandle pointing to the sound file.
      Returns:
      A SoundFileType enum representing the type of the sound file, or null if it cannot be determined.
      Throws:
      IOException - If an I/O error occurs while reading the file.
    • isAiffHeader

      public static boolean isAiffHeader(byte[] header)
      Checks if the provided byte array represents an AIFF (Audio Interchange File Format) header.
      Parameters:
      header - The byte array containing the header data to be checked.
      Returns:
      true if the header represents an AIFF file, false otherwise.
    • isAifcHeader

      public static boolean isAifcHeader(byte[] header)
      Checks if the provided byte array represents an AIFC header.
      Parameters:
      header - The byte array containing the header data to be checked.
      Returns:
      true if the header represents an AIFC file, false otherwise.
    • isWavHeader

      public static boolean isWavHeader(byte[] header)
      Checks if the provided byte array represents a WAV header.
      Parameters:
      header - The byte array containing the header data to be checked.
      Returns:
      true if the header represents a WAV file, false otherwise.
    • isQoaHeader

      public static boolean isQoaHeader(byte[] header)
      Checks if the provided byte array represents a QOA header.
      Parameters:
      header - The byte array containing the header data to be checked.
      Returns:
      true if the header represents a QOA file, false otherwise.
    • isFlacHeader

      public static boolean isFlacHeader(byte[] header)
      Checks if the provided byte array represents a FLAC header.
      Parameters:
      header - The byte array containing the header data to be checked.
      Returns:
      true if the header represents a FLAC file, false otherwise.
    • isOggHeader

      public static boolean isOggHeader(byte[] header)