YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.client.RealTimePacer Class Reference

Holds the producer of audio at real time (issue #325, the source role): the player of the app hands over audio as fast as it decodes it unless something waits for it, and a source has no player at the other end that does. More...

Collaboration diagram for de.yaacc.sendspin.client.RealTimePacer:
Collaboration graph

Classes

interface  Sleeper
 Waits for some time. More...
 

Public Member Functions

 RealTimePacer (LongSupplier nanos, Sleeper sleeper)
 
void reset ()
 Starts the schedule again (the next piece is a new start).
 
void pace (long durationNanos) throws InterruptedException
 

Static Public Member Functions

static RealTimePacer system ()
 The system clock and Thread#sleep.
 

Detailed Description

Holds the producer of audio at real time (issue #325, the source role): the player of the app hands over audio as fast as it decodes it unless something waits for it, and a source has no player at the other end that does.

Each piece says how long it lasts; the writer waits so that the audio handed over is never more than a short head start ahead of the clock. A gap (a pause, a seek) starts the schedule again. Not thread safe: one writer.

Member Function Documentation

◆ pace()

void de.yaacc.sendspin.client.RealTimePacer.pace ( long durationNanos) throws InterruptedException
Parameters
durationNanoshow long the piece that was just handed over lasts; waits as long as the writer is ahead

The documentation for this class was generated from the following file: