I have a video that I'm stripped the audio from, its sampled at 48000 when I
strip the audio I'd like it to be 44100. How do I go about doing that? I have
the graph the creates the wave file, I'd just like to know how I input put the
sample rate info, in a filter, in a pin?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It isn't simply a matter of setting the media type. You need a filter that
will actually re-sample the audio down to 44100. Don't know of one off-hand.
I've just never needed one.
In general, however, you just set the audio media type the same way you set a
video type. The most common value (that I've seen) uses a WaveFormatEx struct.
I don't know how useful it would be, but you can see some fiddling with audio
in Samples\DMO\DmoSplit\dmo\DmoSplit.cs
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It isn't just a simple matter of changing a value in the .wav file's header.
Someone actually needs to discard the excess data from the stream. Preferably,
whoever does it don't just chop off the extra bits, but averages things out to
keep the best possible audio quality.
And to do that, someone has to write code. Probably not a lot of code, but
someone's got to do it. So, yes, what you need is a filter that will take an
input of 48000 and let you set the output pin to 44100, but the filter needs
to have the smarts built in to understand what that means and to do the work
accordingly. I just don't think MS provides one by default.
So, you will either need to find such a filter, or consider some other format
(like WMA) that has a filter made for it.
Also, there are undoubtedly utilities out there to do this as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a video that I'm stripped the audio from, its sampled at 48000 when I
strip the audio I'd like it to be 44100. How do I go about doing that? I have
the graph the creates the wave file, I'd just like to know how I input put the
sample rate info, in a filter, in a pin?
Thanks
It isn't simply a matter of setting the media type. You need a filter that
will actually re-sample the audio down to 44100. Don't know of one off-hand.
I've just never needed one.
In general, however, you just set the audio media type the same way you set a
video type. The most common value (that I've seen) uses a WaveFormatEx struct.
I don't know how useful it would be, but you can see some fiddling with audio
in Samples\DMO\DmoSplit\dmo\DmoSplit.cs
So I can't just set one of the filters in my graph to output 44100?
It isn't just a simple matter of changing a value in the .wav file's header.
Someone actually needs to discard the excess data from the stream. Preferably,
whoever does it don't just chop off the extra bits, but averages things out to
keep the best possible audio quality.
And to do that, someone has to write code. Probably not a lot of code, but
someone's got to do it. So, yes, what you need is a filter that will take an
input of 48000 and let you set the output pin to 44100, but the filter needs
to have the smarts built in to understand what that means and to do the work
accordingly. I just don't think MS provides one by default.
So, you will either need to find such a filter, or consider some other format
(like WMA) that has a filter made for it.
Also, there are undoubtedly utilities out there to do this as well.
Microsoft provide a DMO object that can do that: http://msdn.microsoft.com
/en-us/library/dd443196(VS.85).aspx
This DMO is available in Vista and in Seven...
Using it in DirectShow: http://msdn.microsoft.com/en-
us/library/dd407273(VS.85).aspx