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

3D Sound and Doppler effect

Last post 4/27/2007 12:33 PM by Shawn Hargreaves. 9 replies.
  • 4/25/2007 7:45 PM

    3D Sound and Doppler effect

    Anyone get an RPC to work with the implicit DopplerPitchScaler variable?

    I can get Distance and OrientationAngle to drive an RPC using Cue.Apply3D but it doesn't seem to effect DopplerPitchScaler (as I'm using it).

    I created an RPC and added 2 curves to it.  One for Distance to Volume, the other for DopplerPitchScaler to Pitch.  I have also played around with various values for the SpeedOfSound variable to see if it had an effect, but it did not.

    If I replace the variable DopplerPitchScaler with OrientationAngle to effect Pitch in the RPC, it works as expected, but that's not what I want.

    Any suggestions?  experience?

     

  • 4/26/2007 5:51 PM In reply to

    Re: 3D Sound and Doppler effect

    Is there anyone from MS or not with any help on this?
  • 4/26/2007 6:23 PM In reply to

    Re: 3D Sound and Doppler effect

    Funnily enough it looks like our new content is going up even as I type this:

    http://creators.xna.com/Headlines/developmentaspx/archive/2007/02/22/Audio-3D-Sample.aspx

    XNA Framework Developer - blog - homepage
  • 4/26/2007 8:31 PM In reply to

    Re: 3D Sound and Doppler effect

    awesome!  can't wait to try that sample :-)
    Joel Martinez - XNA MVP
    Blog: http://codecube.net
    XNA Unit Testing: Scurvy Test
  • 4/26/2007 9:31 PM In reply to

    Re: 3D Sound and Doppler effect

    Shawn, it does not appear that the doppler effect works in the sample either. 

    I already had the Apply3D thing working okay, at least using Distance/Volume and OrientationAngle/Pitch RPC's.  But, I am unable to get DopplerPitchScaler/Pitch RPC's to work.

  • 4/26/2007 9:58 PM In reply to

    Re: 3D Sound and Doppler effect

    ClydeCoulter:

    Shawn, it does not appear that the doppler effect works in the sample either. 



    Sure it does: if you move around quickly you'll hear the sounds change pitch as you fly past them. The effect is most pronounced if you try to line yourself up so you go past the cat in exactly the opposite direction, but you can hear it with the dog, too (more subtle because the dog is not itself moving).
    XNA Framework Developer - blog - homepage
  • 4/26/2007 10:28 PM In reply to

    Re: 3D Sound and Doppler effect

    Your right, it does work in the sample.  I was unable to tell with 3 different cat sounds, some of them changing pitch (the cat changing it's pitch) so I removed 2 of the cat variations and made the pitch curve steeper, then I could hear the difference.

    I still can't figure out why it doesn't work in my project.........I had set everything up similar to the sample......ecept I was using 2 curves in the RPC, I have split it up to 2 RPC, one for distance/volume and one for DopplerPitchScaler/Pitch to see if it will work.......

  • 4/26/2007 10:59 PM In reply to

    Re: 3D Sound and Doppler effect

    What scale is your game using?

    The doppler effect is relative to the speed of sound, which obviously depends on what units your game is using to come out correct. There is a global variable you can modify in the XACT project to tweak this (I forget what is called) to match the scale of your game world. Try turning that up until you hear it making a difference.
    XNA Framework Developer - blog - homepage
  • 4/27/2007 12:27 AM In reply to

    Re: 3D Sound and Doppler effect

    Answer
    Reply Quote

    (Clyde pulls Shawn off to the side and speaks quietly)

    I forgot to set the emitters velocity and only set the listeners velocity (which was sitting still :|

    (Then shouts loudly)

    It works now :)

     

  • 4/27/2007 12:33 PM In reply to

    Re: 3D Sound and Doppler effect

    Hurrah!

    (ideally shouted out with a suitable doppler shift in betwen the "ur" and "ah" sounds :-)
    XNA Framework Developer - blog - homepage
Page 1 of 1 (10 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG