|
|
static List< String > | parseSupportedCodecs (JSONObject serverHello) |
| | The codecs the server takes, read by a source from the server/hello; empty if the server takes no source.
|
| |
|
static String | serverCommand (boolean start) |
| | server/command that starts or stops the source.
|
| |
| static String | parseServerCommand (JSONObject payload) |
| |
|
static String | clientState (boolean available, String signal) |
| | client/state of a source: whether it is available and whether it has audio to offer (present or absent).
|
| |
|
static State | parseState (JSONObject payload) |
| | The availability and the signal of a client/state (an unknown signal counts as none).
|
| |
|
static String | clientStreamStart (String codec, int channels, int sampleRate, int bitDepth, String codecHeader) |
| | client-stream/start: the format of the stream the source opens (codecHeader: Base64, for FLAC; else null).
|
| |
| static StreamStart | parseClientStreamStart (JSONObject payload) throws ProtocolException |
| |
|
static String | clientStreamEnd () |
| | client-stream/end for the source stream.
|
| |
|
static boolean | endsSource (JSONObject payload) |
| | True if a client-stream/end ends the source stream: it names source, or names no roles (all streams of the client).
|
| |
|
static byte[] | chunk (long serverMicros, byte[] audio, int offset, int length) |
| | The body of a chunk (the type is added by the channel): the capture time in the server clock, big endian, then the audio.
|
| |
| static Chunk | parseChunk (byte[] body) throws ProtocolException |
| |
The messages of the source@v1 role of the Sendspin specification (commit 2cfe197, roles/source/v1.md): a client that feeds audio into a server.
The server decides: it starts the source with server/command (source.command = start or stop); the source announces its format in client-stream/start, sends binary chunks of type 12 (an int64 timestamp in the server clock, big endian, then the encoded audio) and ends with client-stream/end. The source reports source.signal (present or absent) in client/state. The server lists the codecs it takes in source@v1_support.supported_codecs of its server/hello. The client is untrusted: every number is range checked, a violation is a ProtocolException. Pure.