1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! 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](https://github.com/snapcast/snapcast/blob/master/doc/binary_protocol.md)
//! for the full specification.
pub use CustomMessage;
pub use MessageType;
pub use ;
pub use SampleFormat;
pub use Timeval;
/// Default TCP port for binary protocol (streaming clients).
pub const DEFAULT_STREAM_PORT: u16 = 1704;
/// Default TCP port for JSON-RPC control.
pub const DEFAULT_CONTROL_PORT: u16 = 1705;
/// Default HTTP port for JSON-RPC + Snapweb.
pub const DEFAULT_HTTP_PORT: u16 = 1780;
/// Default WebSocket Secure port.
pub const DEFAULT_WSS_PORT: u16 = 1788;
/// Snapcast binary protocol version.
pub const PROTOCOL_VERSION: u32 = 2;
/// Default sample format: 48000 Hz, 16-bit, stereo.
pub const DEFAULT_SAMPLE_FORMAT: SampleFormat = new;
/// Maximum absolute value of a 24-bit signed integer sample (2^23 - 1).
pub const PCM_24BIT_MAX: f32 = 8_388_607.0;
/// Default sample format string used by config files and command-line defaults.
pub const DEFAULT_SAMPLE_FORMAT_STRING: &str = "48000:16:2";
/// Default playout buffer size in milliseconds.
pub const DEFAULT_BUFFER_MS: u32 = 1000;
/// Default mDNS service type for Snapcast discovery.
pub const DEFAULT_MDNS_SERVICE_TYPE: &str = "_snapcast._tcp.local.";
/// Default client display name.
pub const DEFAULT_CLIENT_NAME: &str = "Snapclient";
/// Default server display name.
pub const DEFAULT_SERVER_NAME: &str = "Snapserver";
/// Default TCP bind address for server listeners.
pub const DEFAULT_BIND_ADDRESS: &str = "0.0.0.0";
/// Maximum accepted binary protocol payload size.
pub const DEFAULT_MAX_PAYLOAD_SIZE: u32 = 2 * 1024 * 1024;
/// Plain TCP streaming transport scheme.
pub const SCHEME_TCP: &str = "tcp";
/// WebSocket streaming transport scheme.
pub const SCHEME_WS: &str = "ws";
/// WebSocket-over-TLS streaming transport scheme.
pub const SCHEME_WSS: &str = "wss";
/// Raw PCM codec name.
pub const CODEC_PCM: &str = "pcm";
/// FLAC codec name.
pub const CODEC_FLAC: &str = "flac";
/// Opus codec name.
pub const CODEC_OPUS: &str = "opus";
/// Ogg/Vorbis codec name as used on the Snapcast wire.
pub const CODEC_OGG: &str = "ogg";
/// Lossless f32 LZ4 codec name.
pub const CODEC_F32LZ4: &str = "f32lz4";
/// Encrypted f32 LZ4 command-line/config alias.
pub const CODEC_F32LZ4_ENCRYPTED_ALIAS: &str = "f32lz4e";
/// Default pre-shared key for f32lz4e (encrypted f32lz4) codec.
///
/// Used when the `f32lz4e` codec is selected without an explicit PSK.
/// Provides transport obfuscation out of the box — not a substitute for
/// real key management in security-sensitive deployments.
pub const DEFAULT_ENCRYPTION_PSK: &str = "snapcast-f32lz4e-default-psk-v1";