How can I can use 3DSound in my App?

Using the DirectSound API, you can locate DirectMusic sounds in space and can apply Doppler shift to moving sounds. 3-D effects are applied to individual DirectSound buffers. Because you can direct different sounds along different audio paths, each with its own buffer, it's easy to apply different parameters to different sounds. To apply 3-D effects to a buffer, you must obtain an IDirectSound3DBuffer8 interface to a buffer that has 3-D capabilities, such as one in the DMUS_APATH_DYNAMIC_3D standard audio path. You can also create a suitable audio path from a configuration object that specifies 3-D parameters for a buffer.

To play 3DSound follow the following steps

  1. Create loader object (IDirectMusicLoader8)
  2. Create performance object (IDirectMusicPerformance8)
  3. Initialize the performance with the audio path. This initializes both DirectMusic and DirectSound and sets up the synthesizer.
  4. LoadObjectFromFile
  5. Download the segment's instruments to the synthesizer
  6. Tell DirectMusic to repeat this segment forever
  7. Create an 3D audiopath with a 3D buffer. We can then play all segments into this buffer and directly control its 3D parameters.
  8. Play segment on the 3D audiopath
  9. Get the IDirectSound3DBuffer8 from the 3D audiopath
  10. In the sample app"3DSound.zip" the position of DirectSoundBuffer is varied according to MouseCursor.
FAQ Menu

 
Printer friendly version of the FAQ-DIRECTX-Use-3DSound-In-Apps page


Sponsored links

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SSH and SFTP support for .NET
Add complete SSH and SFTP support to your .NET framework application
ASP.NET 3.5 Hosting on Windows 2008!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!

Advertisement



Free Magazine

Free Magazines
eWeek The essential technology information source for builders of e-business.... subscribe now

Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.