0 Replies - 1137 Views - Last Post: 05 November 2013 - 02:31 AM

#1 mimimintan   User is offline

  • D.I.C Head

Reputation: 41
  • View blog
  • Posts: 68
  • Joined: 17-October 12

Music loops correctly but suddenly stops playing. What.

Posted 05 November 2013 - 02:31 AM

Disclaimer:
I'm a noob. This is my first game, and I'm a terrible coder.
Dealing with me is not for the impatient or "you should know this, idiot" type.

What I'm doing:
Using a .wav file, loading it as a "sound effect" with the game screen,
creating a SoundEffectInstance from it, setting "IsLooped" to true, then playing it.
Tried: Using a shorter file; Making a "Music" method that takes BGM as a parameter
and calling it from inside the constructor, cutting everything else and pasting it there.
No change with the latter.

What happens:
The song starts playing when I enter the game screen (after the start menu),
plays just fine, loops just fine (tested with a shorter file), but will suddenly stop.
The game keeps running and updating. There's just... no music.
It stops in the middle of a (music) bar, not at the end of the file or anything.
I can't tell if it's the same each time, my mind's too frizzled to keep track of two
"instances" of a song at the moment, but it seems to stop after a similar amount of time.

Here's my ("Game Screen") code, take a gander if you'd like.
Pretty much followed exactly what MSDN says. orz
There's nothing new beyond the constructor but I added it there anyway just in case.
Spoiler



Many thanks in advance. Posted Image



Wow apparently there's this thing called a "Song"
I'mma try summa dat.

....tomorrow. Posted Image

This post has been edited by mimimintan: 05 November 2013 - 02:49 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1