• 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: output timestamp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: output timestamp


  • Subject: Re: output timestamp
  • From: Craig Hopson <email@hidden>
  • Date: Thu, 25 May 2006 19:35:10 -0600

On May 25, 2006, at 6:36 PM, William Stewart wrote:


On 25/05/2006, at 4:20 PM, Craig Hopson wrote:

I'm pretty sure this has been asked before, I just can't find it. Sorry for any redundancy...

I have a music sequence. The associated graph uses the default output unit. Sometimes when I start the MS I want the initial time stamp to be greater than 0. That is, I want to be able to start playing at some arbitrary point in the sequence.

I have tried calling MusicPlayerSetTime. However, when I inspect the timestamps in a Render call, they begin @ 0. (How) can I start the graph and get timestamps greater than zero?

You can't. The SetTime will shift the beats time that the sequence thinks of as "now" - and then it offsets that to render at that new time.
Ah, that explains what I'm seeing with the timestamps.

The question is really, why - it doesn't change the sequence/player behaviour, but it sound like you want to do something, but you can't?
Yes. I want to play an arbitrary range of events without changing their position in the overall sequence. My events are custom and I feed them to threaded processors based on their timestamps. The graph is delayed somewhat (custom renderers) to allow processing time. The output of the processors is stored in ring buffers which obey the AU timestamps and fill the render buffers - processing on the backside of the buffers, Render pulls on the front side. For what it's worth, my UI is basically a view of the events in the sequence.

When I play the entire sequence, the MS callback for userEvents calls for each of my events. I dispatch to the appropriate processor. The event is processed and stored in the buffer. My delay units are busy returning 0s until the delay time has passed. The delay is small - just enough to keep processing ahead of rendering.

Now, say the first event I want to play is 2 sec into the sequence, here's what happens: I get the event and go through the above process. Of course, since the event's timestamp is @ 2 sec, I will get 2 secs of silence until the 2 sec timestamp shows up. (Buffers return 0s if the Render timestamp is not one that they can fulfill, or if they don't have any data available, ie., no events have been processed.)

Of course there is more than one way to accomplish this, but I had thought it would be easiest if I could tell the output unit to start its timestamps at the 2 sec point (for example). By starting the output later in time, I would not have to fill the AU buffers with 0 until I hit correct timestamp. Any suggestions?


Craig Hopson Red Rock Software



_______________________________________________
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


  • Follow-Ups:
    • Re: output timestamp
      • From: William Stewart <email@hidden>
References: 
 >output timestamp (From: Craig Hopson <email@hidden>)
 >Re: output timestamp (From: William Stewart <email@hidden>)

  • Prev by Date: Re: output timestamp
  • Next by Date: Beginner: How to set the sampling rate of a USB audio input device
  • Previous by thread: Re: output timestamp
  • Next by thread: Re: output timestamp
  • Index(es):
    • Date
    • Thread