|
-
May 22nd, 2005, 07:28 PM
#1
Using DirectSound to play segment of .wav file
Hi there,
I need to be be able to take a .wav file and play only part of it eg from 200 to 800 ms through the file. I have code that will do it using DirectShow, but I'd like to do it in directSound. Also, I can play the whole file using DirectSound, based on the examples in the SDK, but I don't know how to just play part of it. Is it possible?
I'm using Visual C++ .NET 2003 IDE to write native C++ code, if it makes a difference.
Thank you.
-
May 23rd, 2005, 02:19 AM
#2
Re: Using DirectSound to play segment of .wav file
You can load the full wav file into a static buffer (usually, a small one) or use streaming and callback functions to load parts of the file as they are needed.
You can start from here:
http://www.gamedev.net/reference/art...article710.asp
To play part of it, load the approriate section of the file into a buffer or simply pass an offset to Play.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|