Re: Audio scrub
- From: "Chris P. [MVP]" <msdn@xxxxxxxxxxxx>
- Date: Thu, 9 Mar 2006 21:37:50 -0500
On Thu, 9 Mar 2006 18:28:58 -0600, Bibo mushi wrote:
I am trying to implement audio scrubbing in my player so that if the user
scrubs the slider control, they can hear the audio in the speed they moved
the slider.
First I was just to catch the HScroll message and use IMediaSeeking::SetRate
to set to whatever rate it is.
But I cannot call SetRate with more than 2, it returns
VFW_E_UNSUPPORTED_AUDIO.
Now, I am not sure how to approach this problem.
Any information is greatly appreciated.
Scrubbing is difficult to do right and even harder to implement in
DirectShow.
For your solution you will need to write a custom transform filter. The
transform filter will sit just before the audio renderer and stretch or
shrink the audio data (using a pitch shift) to the appropriate size for the
desired rate.
The pitch shift isn't difficult to implement if you have some basic audio
knowledge. e.g. to double the audio rate, simply copy every other audio
sample, to triple every third sample. Slowing down the rate is actually
harder. To slow down to half speed you can duplicate every sample but you
will hear some aliasing. Better is to use an averaging method or sinc
interpolation.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
.
- Follow-Ups:
- Re: Audio scrub
- From: Bibo mushi
- Re: Audio scrub
- From: Bibo mushi
- Re: Audio scrub
- References:
- Audio scrub
- From: Bibo mushi
- Audio scrub
- Prev by Date: Audio scrub
- Next by Date: Re: Audio scrub
- Previous by thread: Audio scrub
- Next by thread: Re: Audio scrub
- Index(es):
Relevant Pages
|