CartBlanche / MonoGame-Samples

All the Samples that work with MonoGame
https://github.com/MonoGame/MonoGame
700 stars 356 forks source link

MonoGame.StarterKits.Linux: "CardsShuffle.wav" not loading #3

Closed mkosler closed 12 years ago

mkosler commented 12 years ago

When I run the MonoDevelop debugger I get this from the stack trace:


Microsoft.Xna.Framework.Audio.AudioLoader.LoadWave (reader={System.IO.BinaryReader}, format=OpenTK.Audio.OpenAL.ALFormat.Mono8, size=0, frequency=0) in /home/mkosler/MonoGame/MonoGame.Framework/Linux/Audio/AudioLoader.cs:67
Microsoft.Xna.Framework.Audio.AudioLoader.Load (data={System.IO.FileStream}, format=OpenTK.Audio.OpenAL.ALFormat.Mono8, size=0, frequency=0) in /home/mkosler/MonoGame/MonoGame.Framework/Linux/Audio/AudioLoader.cs:36
Microsoft.Xna.Framework.Audio.Sound..ctor (filename="Content/Sounds/CardsShuffle.wav", volume=1, looping=false) in /home/mkosler/MonoGame/MonoGame.Framework/Linux/Audio/Sound.cs:122
Microsoft.Xna.Framework.Audio.SoundEffect..ctor (fileName="Content/Sounds/CardsShuffle.wav") in /home/mkosler/MonoGame/MonoGame.Framework/Audio/SoundEffect.cs:66
Microsoft.Xna.Framework.Content.ContentManager.ReadAsset (assetName="Content/Sounds/CardsShuffle.wav", recordDisposableObject=(null)) in /home/mkosler/MonoGame/MonoGame.Framework/Content/ContentManager.cs:281
Microsoft.Xna.Framework.Content.ContentManager.Load (assetName="Sounds/CardsShuffle") in /home/mkosler/MonoGame/MonoGame.Framework/Content/ContentManager.cs:88
Blackjack.AudioManager.LoadSound (contentName="CardsShuffle", alias="Shuffle") in /home/mkosler/MonoGame/MonoGame-Samples/StarterKits/MacOS/Cards/CardsGame/Misc/AudioManager.cs:83
Blackjack.AudioManager.LoadSounds () in /home/mkosler/MonoGame/MonoGame-Samples/StarterKits/MacOS/Cards/CardsGame/Misc/AudioManager.cs:116
Blackjack.BlackjackGame.LoadContent () in /home/mkosler/MonoGame/MonoGame-Samples/StarterKits/MacOS/Cards/CardsGame/BlackjackGame.cs:101
Microsoft.Xna.Framework.Game.Initialize () in /home/mkosler/MonoGame/MonoGame.Framework/Linux/Game.cs:395
Blackjack.BlackjackGame.Initialize () in /home/mkosler/MonoGame/MonoGame-Samples/StarterKits/MacOS/Cards/CardsGame/BlackjackGame.cs:77
Microsoft.Xna.Framework.Game.Run () in /home/mkosler/MonoGame/MonoGame.Framework/Linux/Game.cs:251
Blackjack.Program.Main () in /home/mkosler/MonoGame/MonoGame-Samples/StarterKits/Linux/Cards/BlackJack/Program.Linux.cs:29

It seems to be something specific to "CardsShuffle.wav", since audioManager.soundBank contains both "Bet.wav" and "CardFlip.wav" by the time this gets thrown.

CartBlanche commented 12 years ago

Could it be a case sensitivity issue? It may also be worth checking the properties of CardsShuffle.wav and just make sure it is set to be included in the build process.

urkle commented 12 years ago

This file has an extra "bext" RIFF section BEFORE the fmt section. The AudioLoader in monogame doesn't expect that, and barfs when it sees the unexpected section.

See https://github.com/mono/MonoGame/pull/375 which contains a fix for the bext, as well as correct(better?) handling of finding the data section of the WAV file.

urkle commented 12 years ago

The fixes for this issue has landed in the monogame/develop branch