Xaudio2 attach sound to specific channel

For questions about using Classic.

Post » Sun Aug 30, 2009 4:26 pm

[quote:wh05hfsf] Autoplaying

XAudio2 provides numbered channels on which to play sounds. Autoplaying a sound means playing it on any channel which is not currently playing something else. This is a convenient way to assign sounds to channels. [/quote:wh05hfsf]

This is only convenient if I know the order in which the sounds will be played.
We need a way to set a specific sound to a specific channel.
Unless someone knows a way to do this some other way......
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sun Aug 30, 2009 5:34 pm

Then don't autoplay it, just use the load/play actions to play it on a specific channel?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Aug 30, 2009 7:25 pm

Ah, perhaps a better name like "Load to channel".
Problem with "play"ing sounds is you have to reload it each time you want to play it again.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sun Aug 30, 2009 10:08 pm

If the cache is enabled loading is effectively free (as in takes no extra CPU/disk activity), or you can rewind a sound back to the beginning to replay it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Sep 02, 2009 8:23 am

YOU HAVE TO RELOAD THEM?!?!?!?

Okay. I would have never figured that out.
Will try it out, sometimes you just need manual play.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Sep 03, 2009 5:49 pm

The channel is released when it finishes so other sounds can play on it - if it didn't need reloading and kept the same sound in, eventually an autoplay might overwrite the channel, then you're playing a different sound unintentionally. Depending on the cache settings it also gives the opportunity to free the memory straight away. Loading is basically free with the cache enabled though, so it shouldn't be a big deal (and autoplay is designed to take care of the loading for you anyway).
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests