/// <summary>
/// Checks for errors that might have occurred during audio processing.
/// </summary>
/// <param name="silent">If true, errors aren't logged.</param>
/// <returns>True, if an error occurred, false if not.</returns>
public static bool CheckOpenALErrors(bool silent = false)
{
if (sound != null && !sound.IsAvailable)
{
return(false);
}
ALError error;
bool found = false;
while ((error = AL.GetError()) != ALError.NoError)
{
if (!silent)
{
Log.Core.WriteError(
"Internal OpenAL error, code {0} at {1}",
error,
Log.CurrentMethod(1));
}
found = true;
}
if (found && !silent && System.Diagnostics.Debugger.IsAttached)
{
System.Diagnostics.Debugger.Break();
}
return(found);
}