ddevault/TrueCraft

Running TrueCraft on Win10: AudioManager.PlayPack exception in method

IAbstract opened this issue · 3 comments

I am getting a DivideByZeroException in PlayPack at the call to CreatInstance():

    public void PlayPack(string pack, float volume = 1.0f)
    {
        var i = MathHelper.Random.Next(0, AudioPacks[pack].Length);
        var instance = AudioPacks[pack][i].CreateInstance();
        instance.Volume = volume * EffectVolume;
        instance.Play();
    }

Any ideas on a workaround? What other information do you need?

Do you have the full stack trace by chance?

StackTrace as requested. FWIW, I am using VS2013 Community Edition.

at Microsoft.Xna.Framework.Audio.OALSoundBuffer.BindDataBuffer(Byte[] dataBuffer, ALFormat format, Int32 size, Int32 sampleRate)
at Microsoft.Xna.Framework.Audio.SoundEffect.PlatformSetupInstance(SoundEffectInstance inst)
at Microsoft.Xna.Framework.Audio.SoundEffect.GetPooledInstance(Boolean forXAct)
at Microsoft.Xna.Framework.Audio.SoundEffect.Play(Single volume, Single pitch, Single pan)
at TrueCraft.Client.AudioManager.PlayPack(String pack, Single volume) in d:\TrueCraft\TrueCraft.Client\AudioManager.cs:line 115
at TrueCraft.Client.Modules.PlayerControlModule.PlayFootstep() in d:\TrueCraft\TrueCraft.Client\Modules\PlayerControlModule.cs:line 281
at TrueCraft.Client.Modules.PlayerControlModule.Update(GameTime gameTime) in d:\TrueCraft\TrueCraft.Client\Modules\PlayerControlModule.cs:line 355
at TrueCraft.Client.TrueCraftGame.Update(GameTime gameTime) in d:\TrueCraft\TrueCraft.Client\TrueCraftGame.cs:line 351
at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.OpenTKGamePlatform.RunLoop()
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
at Microsoft.Xna.Framework.Game.Run()
at TrueCraft.Client.Program.Main_Thread(String[] args) in d:\TrueCraft\TrueCraft.Client\Program.cs:line 55
at TrueCraft.Client.Program.Main(String[] args) in d:\TrueCraft\TrueCraft.Client\Program.cs:line 21

install openal