Skip to content

Commit

Permalink
AudioManager PlaySoundEffect handles Corrupted State Exceptions as Ap…
Browse files Browse the repository at this point in the history
…ply3D might throw them under some circumstances; FAudio.dll update
  • Loading branch information
jonas committed Feb 26, 2019
1 parent c2f2a1f commit d9fd7b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file modified lib/FAudio.dll
Binary file not shown.
5 changes: 3 additions & 2 deletions src/STACK/Components/Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Xna.Framework.Media;
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;

namespace STACK.Components
{
Expand Down Expand Up @@ -303,6 +304,7 @@ public void LoadSoundEffect(string soundEffect)
/// </summary>
/// <param name="soundEffect"></param>
/// <returns>SoundEffectInstance, or null if in fast forward mode</returns>
[HandleProcessCorruptedStateExceptions]
public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = false, AudioEmitter emitter = null, AudioListener listener = null)
{
if (null != SkipContent.SkipCutscene && SkipContent.SkipCutscene.Enabled)
Expand All @@ -313,8 +315,6 @@ public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = fal
LoadSoundEffect(soundEffect);
var Instance = SoundEffects[soundEffect].CreateInstance();

PlayingInstances.Add(Instance);

Instance.Volume = EffectiveSoundEffectVolume;
Instance.IsLooped = looped;
if (null != emitter && null != listener)
Expand All @@ -329,6 +329,7 @@ public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = fal
}
}

PlayingInstances.Add(Instance);

if (!SoundDisabled)
{
Expand Down

0 comments on commit d9fd7b3

Please sign in to comment.