Jump to content
  • Advertisement
Sign in to follow this  

DirectSound and Notify

This topic is 5041 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

Am working on a game that is a robot/PC hybrid mix. Need some help with audio: if anyone can point me in the right direction, would appreaciate it. Would also be happy to pay for a codesample to be written: this is not really my specialty. I have to animate a robot who's mouth needs to be in synch with the speech played from a wav file. I know the exact timing in milliseconds where mouth events are to occur. I have two files, really, a wav file and a timing file. The wav contains the robots speech, the timing file tells me when to open and close the mouth to synch with speech. Presently I am playing the audio with mcicommandstring, and running a timer in the background that fires events according to the timing file...However, this technique is not reliable enough..there is too much drift. Instead, I would like to use DirectSound API to do this since I see that this API has the ability for the programmer to attach event handlers to specific locations in the audio stream. What I would like to do is ask DirectSound to play this wav file, but also tell DirectSound to fire an event whenever certain locations in the playback are encountered. For example, I'd like to tell it to play test.wav, and to fire an event to me at 23msecs, 143 msecs, 2321 msecs, and so on. I have read and searched the web...there are many discussions of this cability of DirectSound, but I have never used this API before and am not very familiar with audio programming generally. I would like sample code showing, in the simplest possible case, the setting of time-oriented events in a directsound playback buffer, and those events being fired. Ideally, I would like this sample code in .NET/C#/VB.NET (there is a managed directsound assembly) but I will take an example in any form. I am also open to entirely different APIs/tools to accomplish this. Direct sound is simply the API that seems best suited since I want this to work on 2000 and XP machines.

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!