Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Running TrueCraft on Win10: AudioManager.PlayPack exception in method #215

Open
IAbstract opened this issue Oct 14, 2015 · 3 comments
Open

Comments

@IAbstract
Copy link

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?

@ddevault
Copy link
Owner

Do you have the full stack trace by chance?

@IAbstract
Copy link
Author

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

@bonesoul
Copy link

bonesoul commented Jan 1, 2016

install openal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants