Using XAudio Correctly...

This forum is currently in read-only mode.
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I am having a frustrating time understanding how to use the XAudio object "correctly" in a few instances.

    Essentially, at the start of each layout I am loading all sound effects and background audio into memory. At the start of each layout the background music functions fine until another sound effect is triggered. Once this happens there is a slight change in volume with the BG music. Also the background music seems to be effected by each trigger of a sound effect in that it acts like it is making a quick skip sound for just a few milliseconds.

    If I use the "Play Music from a file" event everything functions as it should.

    I can't seem to find much information on how to use the XAudio object correctly. Is it recommended to use the "Play Music from a file" event to handle background music for individual layouts or am I just doing something wrong when using events?

    Any help at all is highly appreciated! ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Dont know if you should use that when there is a new plugin:

    scirra.com/forum/plugin-audiere-sound_topic42873.html

  • Oh wow, now that I am 40 layouts into my project I am not sure going back and changing all sound effect events will be likely. I was just hoping it was something simple I was doing wrong with the background music.

  • Dont know if you should use that when there is a new plugin:

    http://www.scirra.com/forum/plugin-audiere-sound_topic42873.htmlThere is another sound plugin. That's all. It doesn't mean, it is better, it doesn't mean, XAudio2 shouldn't be used. In fact, XAudio2 is the (robust) standard plug for audio, shipped with CC, while Audiere is just a second alternative. Both have advantages and disadvantages (e.g. Audiere does not guarantee to play mp3 on all systems and lacks a few important features, while XAudio2 doesn't support mp3 for sound channels and is more technically oriented and therefore might seem harder to work with, when you don't know much about the concept of sound channels)

    I am having a frustrating time understanding how to use the XAudio object "correctly" in a few instances.

    Essentially, at the start of each layout I am loading all sound effects and background audio into memory. At the start of each layout the background music functions fine until another sound effect is triggered. Once this happens there is a slight change in volume with the BG music. Also the background music seems to be effected by each trigger of a sound effect in that it acts like it is making a quick skip sound for just a few milliseconds.

    If I use the "Play Music from a file" event everything functions as it should.

    I can't seem to find much information on how to use the XAudio object correctly. Is it recommended to use the "Play Music from a file" event to handle background music for individual layouts or am I just doing something wrong when using events?

    Any help at all is highly appreciated! ;)

    Make sure to read the wiki. Here is a link to the XAudio2 page.

    If you use a sound channel to play background music, make sure nothing interrupts or changes that channel by reserving it. (See actions under sound).

    It is indeed the better way to play music with the music actions. This allows you to better differentiate between sound and music. Also there are two independent engines used for sounds and music, sounds using XAudio2 (part of DirectX), music using the same engine as Windows Media Player. So they both don't interfere with each other. The music section doesn't use the channel concept (there is only one channel, so to say), so there's no need to reserve anything.

  • Thanks for that Tulimide. I didn't bother checking the wiki because it seemed like I remembered there not being any info there on the XAudio object. Very helpful!

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