Jump to content
  • Advertisement
Sign in to follow this  
rocklobster

Playing audio (pitch manipulation)

This topic is 2473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

Currently, im in need of some code (similar to the Beep(freq, dur) function provided by windows. I need to basically play a note (possibly a piano key sound) provided a frequency and duration. I understand that there is directsound that i can use but i have not been able to find if i can get this functionality from it. I just need some way to be able to play a given frequency without that horrendous BEEP!!! sound, which also seems to pause your system while it is beeping.

If any of you could point me in the right direction i'td be much appreciated.

Regards,

Rocklobster

Share this post


Link to post
Share on other sites
Advertisement
Yes, DirectSound is capable of changing the frequency during playback.

You'd use a simple sine wave sound and adjust the frequency. Just make sure to create your IDirectSoundBuffer with the DSBCAPS_CTRLFREQUENCY caps flag set.


You can then change the frequency with a call to IDirectSoundBuffer:.SetFrequency

Share this post


Link to post
Share on other sites
Thanks for the info!

I've included Microsoft.DirectX.DirectSound into my project but i am not sure how to access [color="#1C2837"]IDirectSoundBuffer.
[color="#1C2837"]
[color="#1C2837"]I should have also mentioned earlier that i am using c#.
[color="#1C2837"]
[color="#1C2837"]EDIT: I think i found it under private implementation details

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!