I have no problem retrieving the PCM of audio files. I basically set _ammediaType.subType = MediaSubType.PCM;
_ammediaType.formatType = FormatType.WaveEx;
However, I am having a difficult time getting the PCM samples from video files
(the video files contain audio stream as well)
I let the get_StreamMediaType() method fill the AMMediaType structure for me,
then I override the subType = MediaSubType.PCM, but I got an run-time error at
filter.connect() No combination of intermediate filters could be found to make the connection
Could anyone tell me how to get the PCM samples of the audio stream in a video
file?
Thank you,
kab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Have you tried rendering the file in graphedt? You can check the output types
for each of the filters. Presumably somewhere before you hit the renderer, the
type will be what you need.
What that information, you can build the graph the does what you need.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just tried rendering my audio file connection (I got the PCM) and video file
connection (I got something else other than the PCM) with GraphEdt, and I
think I found the problem.
Audio File connection:
Video File connection:
It seems like I need to connect the audio pin instead of the video pin to the
input of the BaseGrabber Filter.
I connect the two pins with the following code IPin iPinSrcOut =
DsFindPin.ByDirection(baseSrcFlt, PinDirection.Output, 0);
so I thought changing the index from 0 to 1 would fix the problem.
But it doesn't seem to be as simple as I thought. When I connect the pin, I
got an expcetion:
{"No combination of intermediate filters could be found to make the
connection."}
Is it because the audio stream in the VideoFile is different from the audio
stream in the AudioFile? or am I just totally off by replacing the 0 with 1 to
the ByDirection parameter?
Thank you,
kab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I open the wmv file by rendering the media file; when the media file is
loaded, I right clicked on the audio out pin, and select "Pin
Properties". When I click on the "Pin Properties", it gave me
an error "The requested property page could not be displayed".
Here is a link to the file which I am working with, could you please take a
look?
One thing that I noticed was the Sample rate. The Sample rate is 44.100 KHz
instead of 8.000 KHz (my normal wav file has 8 KHz, and I was able to get the
PCM samples from it)
Anyway, I am still trying to figure out how to connect the audio pin instead
of the video pin to my next filter.
Any suggestions is appreciated.
Thank you,
kab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry I forgot to mention that part of the test.
The "Render Pin" is non-responsive.. I right clicked on the audio
pin, and I clicked on "Render Pin", but nothing happened, I clicked
on "Reconnect Pin", and nothing happened either.
Any idea?
Thank you,
kab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added a "Default WaveOut Device" as the audio renderer, and
dragged a link between my Raw Audio and the Default WaveOut Device, then I got
a green box WMAudio Decoder DMO0009 in between the two.
Is that what you wanted to know?
Thank you,
kab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And what is the output type of the "WMAudio Decoder?" Is it the PCM
you were looking for? If so, when you build your graph, add that filter
between the reader and the grabber.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I have no problem retrieving the PCM of audio files. I basically set
_ammediaType.subType = MediaSubType.PCM; _ammediaType.formatType = FormatType.WaveEx;However, I am having a difficult time getting the PCM samples from video files
(the video files contain audio stream as well)
I let the get_StreamMediaType() method fill the AMMediaType structure for me,
then I override the subType = MediaSubType.PCM, but I got an run-time error at
filter.connect()
No combination of intermediate filters could be found to make the connectionCould anyone tell me how to get the PCM samples of the audio stream in a video
file?
Thank you,
kab
Are you sure that the video file in question stores its audio samples as PCM?
Hi Snarfle,
The subType of the audio stream in the video file is
00000161-0000-0010-8000-00AA00389B71 which is WMMEDIASUBTYPE_WMAudioV2 in
Windows Media Type.
Here is the link: http://msdn.microsoft.com/en-
us/library/dd757532%28VS.85%29.aspx
Does that mean I cannot interpret its audio stream with PCM?
What I am trying to accomplish is to draw waveforms by calculating the PCM of
media files.
Thank you,
kab
Have you tried rendering the file in graphedt? You can check the output types
for each of the filters. Presumably somewhere before you hit the renderer, the
type will be what you need.
What that information, you can build the graph the does what you need.
Hi snarfle,
I just tried rendering my audio file connection (I got the PCM) and video file
connection (I got something else other than the PCM) with GraphEdt, and I
think I found the problem.
Audio File connection:
Video File connection:
It seems like I need to connect the audio pin instead of the video pin to the
input of the BaseGrabber Filter.
I connect the two pins with the following code
IPin iPinSrcOut = DsFindPin.ByDirection(baseSrcFlt, PinDirection.Output, 0);so I thought changing the index from 0 to 1 would fix the problem.
IPin iPinSrcOut = DsFindPin.ByDirection(baseSrcFlt, PinDirection.Output, 1);
But it doesn't seem to be as simple as I thought. When I connect the pin, I
got an expcetion:
{"No combination of intermediate filters could be found to make the
connection."}
Is it because the audio stream in the VideoFile is different from the audio
stream in the AudioFile? or am I just totally off by replacing the 0 with 1 to
the ByDirection parameter?
Thank you,
kab
Hmm, the picture links didn't work as expected, here they are again:
Audio File Connection: http://s169433840.onlinehome.us/graphedtAudio.JPG
Video File Connection: http://s169433840.onlinehome.us/graphedtVideo.JPG
While you have the wmv file open in GraphEdt, right click on the audio pin and
check out its media type. What do you see?
Also, right click on the audio pin, and choose Render. What does the new graph
look like?
Hi snarfle,
I open the wmv file by rendering the media file; when the media file is
loaded, I right clicked on the audio out pin, and select "Pin
Properties". When I click on the "Pin Properties", it gave me
an error "The requested property page could not be displayed".
Here is a link to the file which I am working with, could you please take a
look?
http://s169433840.onlinehome.us/myVideoFile.wmv
Thank you,
kab
Have you try register (regsrv32) proppage.dll ?
Hi chossette,
Ahh, thanks, I just registered proppage.dll, and I am able to see the audio
type now.
Here is a screenshot of the auido type: http://s169433840.onlinehome.us/audio
MediaTypeOfVideoFile.JPG
One thing that I noticed was the Sample rate. The Sample rate is 44.100 KHz
instead of 8.000 KHz (my normal wav file has 8 KHz, and I was able to get the
PCM samples from it)
Anyway, I am still trying to figure out how to connect the audio pin instead
of the video pin to my next filter.
Any suggestions is appreciated.
Thank you,
kab
Remember when I asked you to "right click on the audio pin, and choose
Render. What does the new graph look like?" How did that turn out?
Hi snarfle,
Sorry I forgot to mention that part of the test.
The "Render Pin" is non-responsive.. I right clicked on the audio
pin, and I clicked on "Render Pin", but nothing happened, I clicked
on "Reconnect Pin", and nothing happened either.
Any idea?
Thank you,
kab
Hmm. That's odd. I don't think I've seen it do that. I've seen it not work,
but it usually gives a (useless) error message.
How about adding an audio renderer and dragging a line between the two?
Hi snarfle,
I added a "Default WaveOut Device" as the audio renderer, and
dragged a link between my Raw Audio and the Default WaveOut Device, then I got
a green box WMAudio Decoder DMO0009 in between the two.
Is that what you wanted to know?
Thank you,
kab
And what is the output type of the "WMAudio Decoder?" Is it the PCM
you were looking for? If so, when you build your graph, add that filter
between the reader and the grabber.