# Orbit game audio — browser and Mac client Orbit exposes game audio on the same origin as the launcher: https://orbit.vainsoft.io. Direct LAN access remains http://192.168.1.100:6086. Use wss:// for HTTPS and ws:// for LAN HTTP. Video and input continue to use RFB. Audio uses a separate receive-only WebSocket. 1. GET /api/bootstrap and read token and session.game_pid. 2. GET /api/audio/status; available must be true. Older sessions need a restart. 3. Connect wss://orbit.vainsoft.io/api/audio/stream?token=TOKEN. 4. The first text message describes the format (type=format, protocol=orbit-audio, version=1). 5. Subsequent binary messages each contain a 16-byte header and exactly 960 stereo frames (20 ms). Header, all numeric fields little endian: - Bytes 0–3: ASCII OAUD. - Bytes 4–7: uint32 sequence, wrapping at 2^32. - Bytes 8–15: uint64 frame_position, increasing by 960 per packet. Payload: 7680 bytes of interleaved float32 PCM, 48,000 Hz, left then right. Values are normally -1 to +1. Validate lengths and reject nonfinite samples in a native client. frame_position is relative to this capture session. It is not a synchronized video timestamp. A newly connected client may begin at a nonzero sequence/position if another client is already listening. For macOS, use AVAudioEngine with AVAudioPlayerNode. Deinterleave into an AVAudioPCMBuffer with a 48 kHz, two-channel float32 format; connect it to the main mixer. Let the engine perform device-rate conversion. Keep approximately 40–80 ms buffered. Use a bounded queue, discard stale audio after sequence gaps or excessive queued duration, and restart scheduling from the current playback time. Never accumulate seconds of sound behind the picture. Do not play on a network callback or block reception waiting for playback. Track buffer underruns and dropped packets separately. Mute/volume are local client operations. Close the audio socket when leaving the game, stopping, sleeping, or changing game_pid. A socket close requires a fresh connection; after a launcher restart, fetch a new bootstrap token first. Closing audio does not stop the game or its RFB stream. The server closes slow clients and drops queued old chunks to keep the game unaffected. Browser: click Enable audio in Now playing. A user gesture is required by browser autoplay policy. Volume is independent of the native client. Switching tabs pauses browser audio. The browser scheduler works on ordinary LAN HTTP; it does not require AudioWorklet or HTTPS. GET /api/audio/contract is the machine-readable contract. GET /api/audio/status reports client count, capture packet count, recent peak/RMS, dropped server queue packets, and capture errors. No microphone is opened. Only the private game sink monitor is captured. Raw stereo PCM uses about 3.1 Mbit/s per client, in addition to the RFB video stream. Audio availability confirms the transport, not audio compatibility for every game. RFB does not provide video presentation timestamps, so this version cannot promise exact A/V sync.