Problem with XAudio2

This forum is currently in read-only mode.
  • Hello, this is my first post.

    Sorry if the question is resolved, I used the search but found no solutions.

    When I use XAudio2 I have a problem with FPS.

    The first thing I load the wav to resources. Then, after the conditions put to action: XAudio2: Autoplay resource "sound.wav" (No Loop). (Sound is played every 150 ms)

    When I start the game after some time FPS drops.

    Please help.

    PS: Sorry for my English, translated online.

  • Hello, this is my first post.

    Sorry if the question is resolved, I used the search but found no solutions.

    When I use XAudio2 I have a problem with FPS.

    The first thing I load the wav to resources. Then, after the conditions put to action: XAudio2: Autoplay resource "sound.wav" (No Loop). (Sound is played every 150 ms)

    When I start the game after some time FPS drops.

    Please help.

    PS: Sorry for my English, translated online.

    I think that since you made the sound play every 150ms automatically, it plays on different channels everytime, and after sometime there are so much open channels that your game lags?

    I could be wrong, I have no idea how the XAudio2 REALLY works.. just guessing.

    I'm still struggling with the XAudio2 too heh, but I think that might be it.

  • Andreyin has a point... you could try loading the sound into it's own channel and playing it that way to see if it helps any. Eh, it couldn't hurt v<img src="http://www.scirra.com/forum/images/smilies/icon_confused.gif">v

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, I'll try as you said.

  • I'm having a lot of trouble with XAudio2, myself.. in my game there's an occasional thunder, and I want it to make a sound, but I'm not sure how to do it.. I tried applying the "run just once" event to when the screen flashes, but if I do that, only the first thunder makes a sound.. the next ones don't.

    What am I doing wrong? ):

  • Are you playing in a channel? Try setting the position back to 0 before you play the channel again. It's probably playing, but since it's at the end it's basically playing nothing.

    Alternatively you could Autoplay the file or resource, then it automatically starts the sound over from the beginning on a random unused channel.

  • Are you playing in a channel? Try setting the position back to 0 before you play the channel again. It's probably playing, but since it's at the end it's basically playing nothing.

    Alternatively you could Autoplay the file or resource, then it automatically starts the sound over from the beginning on a random unused channel.

    I was using autoplay, and it DID work, but suddenly, one day, it stopped.. not sure why ):

    Here's the cap file :

    http://sites.google.com/site/usonic/HER ... ects=0&d=1

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)