WP7 XNA Music and Sound Issue on Nokia Lumia 800

372 Views Asked by At

I am almost done developing my first game for the Windows Phone 7 OS. Unfortunately, I've ran into a rather nasty problem. A simple task of just playing background music and a sound effect at the same time creates a serious distorsion in the sound effect play and the overall result is awful. This is when the sound comes out of the phone's speaker.

If, however, I use the headphones, all the problems go away (i.e., no distorsions whatsoever). I am also using the same code on an HTC HD7 and I don't see the problem either on the speaker or on the headphones.

The sound effect is an MP3 @ 48kbps and the music is also an MP3 @ 96 kbps.

All I do is the following:

In the LoadContent:

backgroundMusic = Content.Load<Song>("Music");
soundEffect = Content.Load<SoundEffect>("SoundEffect");
soundInst = soundEffect.CreateInstance(); / I am using a SoundEffectInstance to play the sound effect

MediaPlayer.Play(backgroundMusic);
MediaPlayer.IsRepeating = true;

Laster on, I just issue a soundInst.Play().

If, however, I do not play any music, the sound effect plays just fine.

Again, this only seems to happen on my Nokia Lumia 800 as it seems ok on the HTC HD7. However, the funny thing is that in the majority of the games that I play on the Lumia 800, I am not noticing this music/sound effect problem (I've only noticed it in one other game).

I have tried to play w/ the volume as well but it doesn't help. Even if the music has a volume of 0, the sound effect is not played correctly.

In conclusion, if and only if I stop the music from playing completly, regardless of the volume, the sound effect plays correctly.

Any ideas?

Thanks in advance!

0

There are 0 best solutions below