Thread View: microsoft.public.directx
2 messages
2 total messages
Started by wyx
Mon, 06 Jul 1998 00:00
about direct show file format
Author: wyx
Date: Mon, 06 Jul 1998 00:00
Date: Mon, 06 Jul 1998 00:00
31 lines
2038 bytes
2038 bytes
hello,
I want to write a direct show source filter which can read a wave
file(.wav) and connect to a
audio renderer filter provided by direct show.
However, I found that I need to specify the file media format (not
media type) in order to
play the file using my filter.
But I have look through those sample source filter codes, none of
them need to specify the file format.
Can anyone tell me at which point the sample source code (say,
async) specify(get) the file format ?
Or do I really need to specify the file format in order to connect
my filter to another filter ?
At the beginning, I just specify the media type and media sub type.
But it fails to connect to another
filter. After adding the code to specify the file format in the
GetMediaType(), the filter works.
So is there any method that can make a source filter without specify
the file format ?
Thank you very much !!
reagrds,
yung
Re: about direct show file format
Author: Jim Chapman
Date: Mon, 06 Jul 1998 00:00
Date: Mon, 06 Jul 1998 00:00
49 lines
2710 bytes
2710 bytes
Yes, you do indeed need to set the file format. There is sample code to do this in the "mpgparse" sample. In this case it looks at the mpeg audio header info and sets the paramaters of the mediatype.format to the correct values. If the format is not set correctly, then you cannot connect to the renderer (since it won't know what frequency the file is,etc.) In your case, since you are reading a wav file you will have to find the same type of info within the wav file so you can set the parameters. I'm sure there are plenty of places on the web where you can get the spec for wav files. Good luck, Jim wyx wrote: > > hello, > > I want to write a direct show source filter which can read a wave > file(.wav) and connect to a > audio renderer filter provided by direct show. > > However, I found that I need to specify the file media format (not > media type) in order to > play the file using my filter. > > But I have look through those sample source filter codes, none of > them need to specify the file format. > > Can anyone tell me at which point the sample source code (say, > async) specify(get) the file format ? > > Or do I really need to specify the file format in order to connect > my filter to another filter ? > At the beginning, I just specify the media type and media sub type. > But it fails to connect to another > filter. After adding the code to specify the file format in the > GetMediaType(), the filter works. > > So is there any method that can make a source filter without specify > the file format ? > > Thank you very much !! > > reagrds, > yung
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads