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

The client side of the source@v1 role without the network (issue #325): the phone has audio to offer (setSignal), the server asks for it (onServerCommand), then the audio of the phone's player is sent in chunks of at most 150 ms that carry the server's clock (write). More...

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

Classes

interface  Wire
 Where the messages go: the secure channel of the session. More...
 

Public Member Functions

 SourceUplink (int sampleRate, LongSupplier serverMicros)
 
synchronized void attach (Wire wire)
 The role is active on this connection (the session tells the state, see signalName()).
 
synchronized String signalName ()
 present or absent: the signal for the client/state.
 
synchronized void detach ()
 The connection is gone or the role is not active any more: nothing is sent; the audio is dropped.
 
synchronized void setSignal (boolean present)
 Whether the phone has audio to offer now (its player plays).
 
synchronized boolean hasSignal ()
 
synchronized boolean isStreaming ()
 
synchronized void onServerCommand (String command)
 A server/command of the source role: start opens the stream, stop ends it.
 
synchronized boolean write (byte[] data, int offset, int length)
 Audio of the player (16 bit stereo at the rate of this uplink).
 

Detailed Description

The client side of the source@v1 role without the network (issue #325): the phone has audio to offer (setSignal), the server asks for it (onServerCommand), then the audio of the phone's player is sent in chunks of at most 150 ms that carry the server's clock (write).

The audio is 16 bit stereo PCM at the rate given. Audio that arrives while the server has not asked for it is dropped. A write may wait for the line (it paces the player that produces the audio).

Member Function Documentation

◆ setSignal()

synchronized void de.yaacc.sendspin.client.SourceUplink.setSignal ( boolean present)

Whether the phone has audio to offer now (its player plays).

Told to the server when it changes.

Here is the call graph for this function:

◆ write()

synchronized boolean de.yaacc.sendspin.client.SourceUplink.write ( byte[] data,
int offset,
int length )

Audio of the player (16 bit stereo at the rate of this uplink).

Returns
false if the line failed (the stream ended); true otherwise, also when the audio was dropped because the server has not asked for it
Here is the call graph for this function:

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