fix a few more compile errors

pull/51/head
cosmonaut 2023-09-19 17:14:48 -07:00
parent 2e5657789c
commit daae1a34b9
3 changed files with 8 additions and 7 deletions

View File

@ -25,7 +25,7 @@ namespace MoonWorks.Audio
if (error != 0) if (error != 0)
{ {
throw new AudioLoadException("Error loading file!"); throw new InvalidOperationException("Error loading file!");
} }
var info = FAudio.stb_vorbis_get_info(handle); var info = FAudio.stb_vorbis_get_info(handle);
@ -77,7 +77,7 @@ namespace MoonWorks.Audio
NativeMemory.Free((void*) FileDataPtr); NativeMemory.Free((void*) FileDataPtr);
Logger.LogError("Error opening OGG file!"); Logger.LogError("Error opening OGG file!");
Logger.LogError("Error: " + error); Logger.LogError("Error: " + error);
throw new AudioLoadException("Error opening OGG file!"); throw new InvalidOperationException("Error opening OGG file!");
} }
} }
} }
@ -111,7 +111,7 @@ namespace MoonWorks.Audio
if (error != 0) if (error != 0)
{ {
throw new AudioLoadException("Error loading file!"); throw new InvalidOperationException("Error loading file!");
} }
var info = FAudio.stb_vorbis_get_info(filePointer); var info = FAudio.stb_vorbis_get_info(filePointer);
var lengthInFloats = var lengthInFloats =

View File

@ -31,13 +31,13 @@ namespace MoonWorks.Audio
UInt64 fileHeader = ReverseEndianness(reader.ReadUInt64()); UInt64 fileHeader = ReverseEndianness(reader.ReadUInt64());
if ((fileHeader >> 32) != QOA_MAGIC) if ((fileHeader >> 32) != QOA_MAGIC)
{ {
throw new AudioLoadException("Specified file is not a QOA file."); throw new InvalidOperationException("Specified file is not a QOA file.");
} }
uint totalSamplesPerChannel = (uint) (fileHeader & (0xFFFFFFFF)); uint totalSamplesPerChannel = (uint) (fileHeader & (0xFFFFFFFF));
if (totalSamplesPerChannel == 0) if (totalSamplesPerChannel == 0)
{ {
throw new AudioLoadException("Specified file is not a valid QOA file."); throw new InvalidOperationException("Specified file is not a valid QOA file.");
} }
UInt64 frameHeader = ReverseEndianness(reader.ReadUInt64()); UInt64 frameHeader = ReverseEndianness(reader.ReadUInt64());
@ -86,7 +86,7 @@ namespace MoonWorks.Audio
{ {
NativeMemory.Free((void*) FileDataPtr); NativeMemory.Free((void*) FileDataPtr);
Logger.LogError("Error opening QOA file!"); Logger.LogError("Error opening QOA file!");
throw new AudioLoadException("Error opening QOA file!"); throw new InvalidOperationException("Error opening QOA file!");
} }
} }
} }
@ -127,7 +127,7 @@ namespace MoonWorks.Audio
{ {
NativeMemory.Free(fileDataPtr); NativeMemory.Free(fileDataPtr);
Logger.LogError("Error opening QOA file!"); Logger.LogError("Error opening QOA file!");
throw new AudioLoadException("Error opening QOA file!"); throw new InvalidOperationException("Error opening QOA file!");
} }
FAudio.qoa_attributes(qoaHandle, out var channels, out var samplerate, out var samples_per_channel_per_frame, out var total_samples_per_channel); FAudio.qoa_attributes(qoaHandle, out var channels, out var samplerate, out var samples_per_channel_per_frame, out var total_samples_per_channel);

View File

@ -20,6 +20,7 @@ using System.Diagnostics;
using System.Text; using System.Text;
using MoonWorks.Math; using MoonWorks.Math;
using MoonWorks.Math.Float; using MoonWorks.Math.Float;
using MoonWorks.Graphics.PackedVector;
#endregion #endregion
namespace MoonWorks.Graphics namespace MoonWorks.Graphics