refactor: rename drift_compensation to adaptive_frame_dropping for clarity
This commit is contained in:
@@ -40,8 +40,8 @@ class AuracastGlobalConfig(BaseModel):
|
||||
# so receivers may render earlier than the presentation delay for lower latency.
|
||||
immediate_rendering: bool = False
|
||||
assisted_listening_stream: bool = False
|
||||
# Clock drift compensation: discard excess samples when buffer exceeds threshold
|
||||
enable_drift_compensation: bool = False
|
||||
# Adaptive frame dropping: discard sub-frame samples when buffer exceeds threshold
|
||||
enable_adaptive_frame_dropping: bool = False
|
||||
|
||||
# "Audio input. "
|
||||
# "'device' -> use the host's default sound input device, "
|
||||
|
||||
@@ -656,7 +656,7 @@ class Streamer():
|
||||
samples_discarded_total = 0 # Total samples discarded
|
||||
discard_events = 0 # Number of times we discarded samples
|
||||
frames_since_last_discard = 999 # Guard: frames since last discard (start high to allow first drop)
|
||||
enable_drift_compensation = global_config.enable_drift_compensation
|
||||
enable_drift_compensation = getattr(global_config, 'enable_adaptive_frame_dropping', False)
|
||||
# Hardcoded parameters (unit: milliseconds)
|
||||
drift_threshold_ms = 2.0 if enable_drift_compensation else 0.0
|
||||
static_drop_ms = 0.5 if enable_drift_compensation else 0.0
|
||||
|
||||
@@ -110,7 +110,7 @@ if __name__ == "__main__":
|
||||
auracast_sampling_rate_hz = LC3_SRATE,
|
||||
octets_per_frame = OCTETS_PER_FRAME,
|
||||
transport=TRANSPORT1,
|
||||
enable_drift_compensation=True,
|
||||
enable_adaptive_frame_dropping=True,
|
||||
)
|
||||
config.debug = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user