Re: Actual sound playing position in DirectShow applications
From: Chris P. [MVP] (msdn_at_chrisnet.net)
Date: 11/10/04
- Next message: Grant Schenck: "Advice on playing multiple streams at the same time"
- Previous message: Iain: "Re: Directx 9.0 October 2004 Update"
- In reply to: Andrey Zharkikh: "Actual sound playing position in DirectShow applications"
- Next in thread: Andrey Zharkikh: "Re: Actual sound playing position in DirectShow applications"
- Reply: Andrey Zharkikh: "Re: Actual sound playing position in DirectShow applications"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 09:20:43 -0500
On Mon, 8 Nov 2004 23:30:03 -0800, Andrey Zharkikh wrote:
> Hello,
>
> I'm writing application where is very critical to know actual audio
> playing position (I'm developing karaoke player). As a matter of fact this
> position is different from position in source file/stream which I can learn
> with GetCurrentPosition method of IMediaSeeking interface of graph. I think
> it is different since preloading, buffering, etc. mechanisms. Another fact
> that timing delta between actual playing music and time reported by
> GetCurrentPosition changing if I change it with m_pMS->SetPositions(&pos,
> AM_SEEKING_AbsolutePositioning , NULL, AM_SEEKING_NoPositioning). What I want
> to learn is position of actially playing data on output sound device or
> possibly actually finished playing sample. What I tried:
> 1) GetCurrentPosition of IMediaSeeking interface
> 2) Put sample grabber before audio rendersing filter into graph and learn
> samples sent to output device implementing ISampleGrabberCB and calling
> GetTime for each coming sample.
There are often problems with the accuracy if
IMediaSeeking::GetCurrentPosition(). You can try using the IMediaPosition
interface of the audio renderer, but I think the results will be the same.
Are you using the DirectSound renderer?
Tricks to try would be to
1) Reduce the audio buffer size, default is 1/2 second per buffer. An easy
way is to insert a transform filter that requests a smaller buffer size.
But I think there is another way through the Graph Manager?
2) As a last resort create a custom renderer. You will have full control
over the audio playback and will always know the exact playing position.
- Next message: Grant Schenck: "Advice on playing multiple streams at the same time"
- Previous message: Iain: "Re: Directx 9.0 October 2004 Update"
- In reply to: Andrey Zharkikh: "Actual sound playing position in DirectShow applications"
- Next in thread: Andrey Zharkikh: "Re: Actual sound playing position in DirectShow applications"
- Reply: Andrey Zharkikh: "Re: Actual sound playing position in DirectShow applications"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|