Package com.mojang.blaze3d.audio
Class OpenAlUtil
java.lang.Object
com.mojang.blaze3d.audio.OpenAlUtil
The OpenALUtil class provides utility functions for working with OpenAL audio.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
alcErrorToString
(int pErrorCode) Converts an ALC error code to a human-readable error message.private static String
alErrorToString
(int pErrorCode) Converts an OpenAL error code to a human-readable error message.(package private) static int
audioFormatToOpenAl
(AudioFormat pFormat) Converts an AudioFormat object to the corresponding OpenAL audio format code.(package private) static boolean
checkALCError
(long pDeviceHandle, String pOperationState) Checks for an ALC error and logs an error message if one is found.(package private) static boolean
checkALError
(String pOperationState) Checks for an OpenAL error and logs an error message if one is found.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
OpenAlUtil
public OpenAlUtil()
-
-
Method Details
-
alErrorToString
Converts an OpenAL error code to a human-readable error message.- Parameters:
pErrorCode
- The OpenAL error code to convert- Returns:
- A String representing the error message for the given error code.
-
checkALError
Checks for an OpenAL error and logs an error message if one is found.- Parameters:
pOperationState
- A String describing the operation being performed when the error occurred- Returns:
- true if an OpenAL error was found, false otherwise.
-
alcErrorToString
Converts an ALC error code to a human-readable error message.- Parameters:
pErrorCode
- The ALC error code to convert- Returns:
- A String representing the error message for the given error code.
-
checkALCError
Checks for an ALC error and logs an error message if one is found.- Parameters:
pDeviceHandle
- The handle of the device to check for errors onpOperationState
- A String describing the operation being performed when the error occurred- Returns:
- true if an ALC error was found, false otherwise.
-
audioFormatToOpenAl
Converts an AudioFormat object to the corresponding OpenAL audio format code.- Parameters:
pFormat
- The AudioFormat object to convert- Returns:
- An integer representing the corresponding OpenAL audio format code.
- Throws:
IllegalArgumentException
- if the given AudioFormat is not a supported format.
-