XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

controlling if a cue loops or not

Last post 19/06/2009 5:00 by Ahnda. 5 replies.
  • 26/10/2007 10:22

    controlling if a cue loops or not

    I guess this isn't possible but I'll ask anyway.
    Is there a way to control if a cue loops or not through code?

  • 26/10/2007 15:58 In reply to

    Re: controlling if a cue loops or not

    Answer
    Reply Quote

    Hi Tom,

    Cues themselves don't technically loop - they can play a sound that loops though. But if you want to dynamically (through code) control the looping behavior, one straightforward way would be to keep the sound itself non-looping. When you start playing the cue, register for a XACTNOTIFICATIONTYPE_CUESTOP notiifcation on it, and when that notification fires, retrigger the cue. If you're concerned about a possible gap between the stop and restart, the content creator can set the cue to be intance limited to 1 (only 1 plays at a time), and set any subsequent retriggers of that cue to 'queue' (rather than replace, fail, etc.). Then you as the programmer could register for the XACTNOTIFICATIONTYPE_CUEPLAY notification, and use that to trigger the next instance, which the XACT engine will keep queued until the previous one finishes.

    Hope this helps!

    Cheers,
    Scott

  • 11/12/2007 10:39 In reply to

    Re: controlling if a cue loops or not

    Hi Scott,

    thanks for the quick answer and sorry for my late reply.
    Well, I thought that I would need to do something like that but luckily I don't anymore. ;)

    Greetings,
    Tom

  • 23/03/2008 23:56 In reply to

    Re: controlling if a cue loops or not

    So could someone post some sample code on how to use XACTNOTIFICATIONTYPE_CUESTOP ?
  • 25/03/2008 6:43 In reply to

    Re: controlling if a cue loops or not

    You could have a look at the XACT game sample and the audio.cpp and go from there.
    You are looking for "XACTNotificationCallback".

    Tom

  • 19/06/2009 5:00 In reply to

    Re: controlling if a cue loops or not

    Tom Wolle:

    You could have a look at the XACT game sample and the audio.cpp and go from there.
    You are looking for "XACTNotificationCallback".

    Tom



    Is it possible to make use of notifications in C#?
Page 1 of 1 (6 items) Previous Next