HCA Audio Codec
- class PyCriCodecsEx.hca.HCA(stream: str | BinaryIO, key: int = 0, subkey: int = 0)[source]
Bases:
object
HCA class for decoding and encoding HCA files
NOTE: Direct usage of this class is not recommended, use the HCACodec wrapper instead.
- __init__(stream: str | BinaryIO, key: int = 0, subkey: int = 0) None [source]
Initializes the HCA encoder/decoder
- Parameters:
stream (str | BinaryIO) – Path to the HCA or WAV file, or a BinaryIO stream.
key (int, optional) – HCA key. Defaults to 0.
subkey (int, optional) – HCA subkey. Defaults to 0.
- encode(force_not_looping: bool = False, encrypt: bool = False, keyless: bool = False, quality_level: CriHcaQuality = CriHcaQuality.High) bytes [source]
Encodes the WAV file to HCA bytes.
- class PyCriCodecsEx.hca.HCACodec(stream: str | bytes, filename: str = 'default.hca', quality: CriHcaQuality = CriHcaQuality.High, key=0, subkey=0, **kwargs)[source]
Bases:
HCA
Use this class for encoding and decoding HCA files, from and to WAV.
- __init__(stream: str | bytes, filename: str = 'default.hca', quality: CriHcaQuality = CriHcaQuality.High, key=0, subkey=0, **kwargs)[source]
Initializes the HCA encoder/decoder
- Parameters:
stream (str | bytes) – Path to the HCA or WAV file, or a BinaryIO stream. WAV files will be automatically encoded with the given settings first.
filename (str, optional) – USM filename. Defaults to “default.hca”.
quality (CriHcaQuality, optional) – Encoding quality. Defaults to CriHcaQuality.High.
key (int, optional) – HCA key. Defaults to 0.
subkey (int, optional) – HCA subkey. Defaults to 0.