Using XAudio Correctly...

For questions about using Classic.

Post » Thu Sep 08, 2011 1:16 am

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! ;)
B
2
G
1
Posts: 37
Reputation: 524

Post » Thu Sep 08, 2011 1:28 am

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

http://www.scirra.com/forum/plugin-audiere-sound_topic42873.html
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Thu Sep 08, 2011 1:35 am

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.
B
2
G
1
Posts: 37
Reputation: 524

Post » Thu Sep 08, 2011 2:41 am

[QUOTE=alspal] Dont know if you should use that when there is a new plugin:

http://www.scirra.com/forum/plugin-audiere-sound_topic42873.html[/QUOTE] There 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)

[QUOTE=nzso] 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! ;) [/QUOTE]
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.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Sep 08, 2011 5:22 pm

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!
B
2
G
1
Posts: 37
Reputation: 524


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests