• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MusicPlayer synchronization with QuickTime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >MusicPlayer synchronization with QuickTime (From: Edwin Vane <email@hidden>)

  • Prev by Date: Re: AudioUnit FormatConverter
  • Next by Date: Re: Accessing AudioCodec from AudioConverter?
  • Previous by thread: MusicPlayer synchronization with QuickTime
  • Next by thread: Writing a private device driver
  • Index(es):
    • Date
    • Thread