Jump to content
  • Advertisement
Sign in to follow this  
azazelo

Custom DirectShow source filter for audio?

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

I was able to play compressed audio files (mp3, wma) using DirectShow. But with too many audio files in my game I need to put all audio in a single database and play them from there. Ideally I need to open a file once, find a position of the track and feed that position and a track length into the graph instead of feeding a file name. What is the best and easiest way to do that? Do I need to create custom source filter for that or there are better or already existing solutions? Any advices, links or helpful google keywords will be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Just create a new filter (I recommend using the baseclasses as it will spare you a lot of work) and implement and expose the IAsyncReader interface on your output pins.

Then when the filter connected to your source filter asks it for data at a x position in the file just read the file at position x+my_file_position (my_file_position being the offset of your file in the pack file).

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!