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

Making sounds go in slow motion?

Last post 02-25-2008 12:01 PM by Srekel. 2 replies.
  • 02-20-2008 4:22 AM

    Making sounds go in slow motion?

    I'd like to be able to play certain sounds at both "normal" speed, and at another, slower speed. My first though was that maybe I can create a content processor that takes the normal sound file and copies it, but then it also makes the speed adjustment to it and saves it as a new file. The problem I guess would be that the xcb (?) file needs to have references to the new sound as well.. right? So I'm not sure it's possible..

    Another possibility would be to do it in real-time, but I'm not sure the XNA audio framework supports that kind of stuff. Anyone know?

    Or are there more options I'm not aware of?
    Project Lead/Programmer on Ragu, DBP finalist.
  • 02-20-2008 7:15 AM In reply to

    Re: Making sounds go in slow motion?

    Answer

    You can indeed do it with a custom processor - create the modified sound file, add it to the XACT project programmatically (including the sounds that use the wave and cues that use the sounds), then go ahead and build the XACT project as normal. However, there's a fair bit of work involved in that, not least of which is a robust XACT project parser.

    Depending on how many waves you're doing this for, you may find it easier to simply add the modified WAV files to the XACT project manually.

    Finally, yes you can do it at runtime by modifying the cue's pitch - but you can only pitch down by a factor of 0.5 that way I think, and when you say "slow the sound" it's not clear whether you're intending the pitch to remain invariant, which XACT can't do (it's non-trivial though there are packages that can do it for you, offline at least).

    Pandemonium, an occasionally updated blog about my game, XNA, games development, and the games industry; XapParse, a parser for XAP (XACT) files
  • 02-25-2008 12:01 PM In reply to

    Re: Making sounds go in slow motion?

    Thanks, I guess we'll go with adding the files manually. ;)
    We're actually going to play them backwards. It would be nice to be able to control their speed in code (i.e. from 1->0.x->0 and then switch to reverse sounds and go from 0->1) but I think we can do without it.
    Project Lead/Programmer on Ragu, DBP finalist.
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG