Enum Class SoundFileType
- All Implemented Interfaces:
Serializable, Comparable<SoundFileType>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic SoundFileTypegetByFileEnding(String fileExtension) Retrieves a SoundFileType enum based on the provided file extension.static booleanisAifcHeader(byte[] header) Checks if the provided byte array represents an AIFC header.static booleanisAiffHeader(byte[] header) Checks if the provided byte array represents an AIFF (Audio Interchange File Format) header.static booleanisFlacHeader(byte[] header) Checks if the provided byte array represents a FLAC header.static booleanisOggHeader(byte[] header) static booleanisQoaHeader(byte[] header) Checks if the provided byte array represents a QOA header.static booleanisWavHeader(byte[] header) Checks if the provided byte array represents a WAV header.static SoundFileTypeparseFromFile(com.badlogic.gdx.files.FileHandle file) Parses a sound file type from the provided FileHandle by examining its header data.static SoundFileTypeReturns the enum constant of this class with the specified name.static SoundFileType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OGG
-
WAV
-
FLAC
-
MP3
-
AIFF
-
QOA
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getByFileEnding
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)
-