MusicPlayer stopping then restarting
MusicPlayer stopping then restarting
- Subject: MusicPlayer stopping then restarting
- From: Michael Norris <email@hidden>
- Date: Wed, 13 Aug 2003 13:42:26 +1200
This topic was discussed back in January, but none of the suggested
solutions seemed to cure with the problem completely, rather they just
improved the symptoms.
I wonder if anyone has discovered the perfect solution...
THE PROBLEM:
When a MusicPlayer sequence is stopped mid-flight, the time reset to
zero then restarted, a very audible "blip" (sometimes quite loud) is
heard as the notes that were playing when MusicPlayer stopped are
flushed from the queue.
The two suggestions in previous posts were:
1) Doing an AudioUnitReset
2) Sending a MIDI notes off message just before and after restarting
Anyone like to comment on the efficacy of these or other methods?
FYI, here's a summary of the code sequence:
NewMusicPlayer(&player);
NewMusicSequence(&sequence);
MusicSequenceNewTrack(sequence,&track);
// add notes using:
MusicTrackNewMIDINoteEvent (
track, timeStamp, ¬eMessage);
MusicPlayerSetSequence (player, sequence);
MusicPlayerPreroll (player);
MusicPlayerStart (player);
// then when mid-flight
MusicPlayerStop (player);
MusicPlayerSetTime(player, 0.0);
// wait a while then:
MusicPlayerPreroll (player);
MusicPlayerStart (player);
// the "blip" is heard
-----------------------
Michael Norris
Composer/Programmer
8 Bidwill St
Mt Cook
Wellington 6002
NEW ZEALAND
-----------------------
Ph: +64 4 803 3644
Web:
http://mnorris.wellington.net.nz
Stroma:
http://stroma.wellington.net.nz
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.