How can I play Background Music in my games?

To play a Background Music you have to follow the following procedures

  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. Play segment on the Default audio path
(It will then continue to play in the background till the user closes the Application) The sample "BkGndMusic.zip" shows how to load a Music File and play it in the BackGnd.

FAQ Menu

 
Printer friendly version of the FAQ-DIRECTX-Background-Music-In-Games 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
3 Months Free - ASP.NET Web Hosting
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!

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.