Xaudio2 attach sound to specific channel

This forum is currently in read-only mode.
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • [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.

    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......

  • Then don't autoplay it, just use the load/play actions to play it on a specific channel?

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • YOU HAVE TO RELOAD THEM?!?!?!?

    Okay. I would have never figured that out.

    Will try it out, sometimes you just need manual play.

  • 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).

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