Skip to main content

Crate snapcast_proto

Crate snapcast_proto 

Source
Expand description

Snapcast binary protocol implementation.

This crate implements the Snapcast binary wire protocol, providing serialization and deserialization for all message types exchanged between snapclient and snapserver.

§Protocol Overview

Every message consists of a BaseMessage header followed by a typed payload. All multi-byte integers are little-endian.

See the protocol documentation for the full specification.

Re-exports§

pub use message::MessageType;
pub use message::base::BaseMessage;
pub use message::base::ProtoError;
pub use sample_format::SampleFormat;
pub use types::Timeval;

Modules§

message
Protocol message types.
sample_format
Audio sample format description.
status
Snapcast status types matching the JSON-RPC wire format.
types
Shared types used across the protocol.

Constants§

CODEC_F32LZ4
Lossless f32 LZ4 codec name.
CODEC_F32LZ4_ENCRYPTED_ALIAS
Encrypted f32 LZ4 command-line/config alias.
CODEC_FLAC
FLAC codec name.
CODEC_OGG
Ogg/Vorbis codec name as used on the Snapcast wire.
CODEC_OPUS
Opus codec name.
CODEC_PCM
Raw PCM codec name.
DEFAULT_BIND_ADDRESS
Default TCP bind address for server listeners.
DEFAULT_BUFFER_MS
Default playout buffer size in milliseconds.
DEFAULT_CLIENT_NAME
Default client display name.
DEFAULT_CONTROL_PORT
Default TCP port for JSON-RPC control.
DEFAULT_ENCRYPTION_PSK
Default pre-shared key for f32lz4e (encrypted f32lz4) codec.
DEFAULT_HTTP_PORT
Default HTTP port for JSON-RPC + Snapweb.
DEFAULT_MAX_PAYLOAD_SIZE
Maximum accepted binary protocol payload size.
DEFAULT_MDNS_SERVICE_TYPE
Default mDNS service type for Snapcast discovery.
DEFAULT_SAMPLE_FORMAT
Default sample format: 48000 Hz, 16-bit, stereo.
DEFAULT_SAMPLE_FORMAT_STRING
Default sample format string used by config files and command-line defaults.
DEFAULT_SERVER_NAME
Default server display name.
DEFAULT_STREAM_PORT
Default TCP port for binary protocol (streaming clients).
DEFAULT_WSS_PORT
Default WebSocket Secure port.
PCM_24BIT_MAX
Maximum absolute value of a 24-bit signed integer sample (2^23 - 1).
PROTOCOL_VERSION
Snapcast binary protocol version.
SCHEME_TCP
Plain TCP streaming transport scheme.
SCHEME_WS
WebSocket streaming transport scheme.
SCHEME_WSS
WebSocket-over-TLS streaming transport scheme.