Skip to content

Commit d9fd7b3

Browse files
author
jonas
committed
AudioManager PlaySoundEffect handles Corrupted State Exceptions as Apply3D might throw them under some circumstances; FAudio.dll update
1 parent c2f2a1f commit d9fd7b3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/FAudio.dll

-7.85 KB
Binary file not shown.

src/STACK/Components/Audio/AudioManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Microsoft.Xna.Framework.Media;
44
using System;
55
using System.Collections.Generic;
6+
using System.Runtime.ExceptionServices;
67

78
namespace STACK.Components
89
{
@@ -303,6 +304,7 @@ public void LoadSoundEffect(string soundEffect)
303304
/// </summary>
304305
/// <param name="soundEffect"></param>
305306
/// <returns>SoundEffectInstance, or null if in fast forward mode</returns>
307+
[HandleProcessCorruptedStateExceptions]
306308
public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = false, AudioEmitter emitter = null, AudioListener listener = null)
307309
{
308310
if (null != SkipContent.SkipCutscene && SkipContent.SkipCutscene.Enabled)
@@ -313,8 +315,6 @@ public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = fal
313315
LoadSoundEffect(soundEffect);
314316
var Instance = SoundEffects[soundEffect].CreateInstance();
315317

316-
PlayingInstances.Add(Instance);
317-
318318
Instance.Volume = EffectiveSoundEffectVolume;
319319
Instance.IsLooped = looped;
320320
if (null != emitter && null != listener)
@@ -329,6 +329,7 @@ public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = fal
329329
}
330330
}
331331

332+
PlayingInstances.Add(Instance);
332333

333334
if (!SoundDisabled)
334335
{

0 commit comments

Comments
 (0)