Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions EXILED/Exiled.API/Features/Audio/WavUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ public static void SkipHeader(Stream stream)
short bits = BinaryPrimitives.ReadInt16LittleEndian(fmtData.Slice(14, 2));

if (format != 1 || channels != 1 || rate != VoiceChatSettings.SampleRate || bits != 16)
throw new InvalidDataException($"Invalid WAV format (format={format}, channels={channels}, rate={rate}, bits={bits}). Expected PCM16, mono and {VoiceChatSettings.SampleRate}Hz.");
{
Log.Error($"[Speaker] Invalid WAV format (format={format}, channels={channels}, rate={rate}, bits={bits}). Expected PCM16, mono and {VoiceChatSettings.SampleRate}Hz.");
throw new InvalidDataException("Unsupported WAV format.");
}

if (chunkSize > 16)
stream.Seek(chunkSize - 16, SeekOrigin.Current);
Expand All @@ -109,7 +112,10 @@ public static void SkipHeader(Stream stream)
}

if (stream.Position >= stream.Length)
throw new InvalidDataException("WAV file does not contain a 'data' chunk.");
{
Log.Error("[Speaker] WAV file does not contain a 'data' chunk.");
throw new InvalidDataException("Missing 'data' chunk in WAV file.");
}
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions EXILED/Exiled.API/Features/Toys/Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ public static Light Create(Vector3? position /*= null*/, Vector3? rotation /*= n
Position = position ?? Vector3.zero,
Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
Scale = scale ?? Vector3.one,
Color = color ?? Color.gray,
};

if (spawn)
light.Spawn();

light.Color = color ?? Color.gray;

return light;
}

Expand Down
Loading