Custom DirectShow source filter for audio?

Started by
0 comments, last by mdias 18 years, 8 months ago
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.
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).

This topic is closed to new replies.

Advertisement