Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 306dc02

Browse files
committed
usm: Always encrypt ADX audio when USMBuilder has a key
1 parent 902c035 commit 306dc02

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

PyCriCodecsEx/adx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def generate_SFA(self, index: int, builder):
116116
0
117117
)
118118
chunk_data = self.sfaStream.read(datalen)
119-
if builder.encrypt_audio:
119+
if builder.usm_key:
120120
SFA_chunk = builder.AudioMask(chunk_data)
121121
SFA_chunk += chunk_data.ljust(datalen + padding, b"\x00")
122122
current_interval += self.CHUNK_INTERVAL

PyCriCodecsEx/usm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ def __init__(
571571
Note:
572572
For USM with key set, HCA audio streams *usually* use the same key for encryption.
573573
Thus when adding HCA audio streams, make sure your HCACodec is initialized with a key itself.
574+
575+
For ADXCodec, this will be ALWAYS encrypted if the USMBuilder is initialized with a key. No
576+
further configuration is needed.
574577
"""
575578
if key:
576579
self.init_key(key)

0 commit comments

Comments
 (0)