Re: MusicPlayer synchronization with QuickTime
Re: MusicPlayer synchronization with QuickTime
- Subject: Re: MusicPlayer synchronization with QuickTime
- From: William Stewart <email@hidden>
- Date: Wed, 28 Dec 2005 11:42:12 -0800
On 26/12/2005, at 8:52 AM, Edwin Vane wrote:
Hi,
I wrote to this list a while back about using the MusicPlayer API to
play MIDI events that were fed to it by QuickTime with the goal of
synchronizing other time-based media in QuickTime with synthesized
music.
Anyway, after finally implementing a prototype, I've come across a
problem. MusicPlayer runs according to its own clock and to keep it in
tandem with QuickTime, I keep calling MusicPlayerSetTime().
However, the
times I get from QuickTime during the MediaIdle() function always seem
to be about 20ms faster than the MusicPlayer and so calling
MusicPlayerSetTime() causes MusicPlayer to jump forward in small steps
all the time, causing notes to be missed.
Try using the MusicPlayer's scale tempo functionality - you can use
this to scale the playback rate, and will not cause any skipping of
events, etc. It is explicitly provided for exactly this kind of need.
SetTime is a much more heavy weight operation as it involves re-
scanning and preparation of the event state, etc.
Bill
I have some further research to do into the 20ms difference (which
appears
regardless of if I continually call MusicPlayerSetTime() in
MediaIdle()). However, I'd like to know if there's anything in the
MusicPlayer API for providing synchronization that is better than
calling MusicPlayerSetTime() all the timer? My looking at the
header file
didn't reveal such functionality.
I've imagiend a fix where I monitor synchronization between
QuickTime and
MusicPlayer and if a threshold is passed, then either MusicPlayer's
rate
is imperceptably increased or decreased until synchronization is ok
again.
I'd be interested in comments in suggestions.
--
Edwin Vane
MMath Candidate
Computer Graphics Lab
School of Computer Science
University of Waterloo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden