{"id":51028359,"url":"https://github.com/Youjose/CriCodecs","last_synced_at":"2026-07-09T23:00:28.479Z","repository":{"id":54350771,"uuid":"522027543","full_name":"Youjose/CriCodecs","owner":"Youjose","description":"Python frontend with a C++ backend for managing Criware formats.","archived":false,"fork":false,"pushed_at":"2026-06-21T07:44:37.000Z","size":360,"stargazers_count":90,"open_issues_count":8,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-06-21T09:15:49.925Z","etag":null,"topics":["acb","adx","audio","awb","cpk","cpp","criware","encoding","hca","python","sofdec","usm"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Youjose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-06T18:44:11.000Z","updated_at":"2026-06-11T16:43:32.000Z","dependencies_parsed_at":"2024-02-28T08:31:18.043Z","dependency_job_id":"d2085288-c634-4815-825a-b6be514fd4e0","html_url":"https://github.com/Youjose/CriCodecs","commit_stats":null,"previous_names":["youjose/cricodecs"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/Youjose/CriCodecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Youjose%2FCriCodecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Youjose%2FCriCodecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Youjose%2FCriCodecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Youjose%2FCriCodecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Youjose","download_url":"https://codeload.github.com/Youjose/CriCodecs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Youjose%2FCriCodecs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35314872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acb","adx","audio","awb","cpk","cpp","criware","encoding","hca","python","sofdec","usm"],"created_at":"2026-06-21T22:00:22.310Z","updated_at":"2026-07-09T23:00:28.471Z","avatar_url":"https://github.com/Youjose.png","language":"C++","funding_links":[],"categories":["🔧 Middleware \u0026 SDKs"],"sub_categories":["CRI"],"readme":"# PyCriCodecs\nPython frontend with a C++ backend for managing Criware formats. \nAlthough for some tasks, python is used purely.\n\n## Supporting\nI am running this on Python 3.11, although other earlier versions might work\n\n\nSo far this lib supports in terms of:\n\nExtracting:\n- ACB/AWB (Incorrect filenames in extraction.)\n- USM (Any USM there is)\n- CPK (Most CPK's)\n\nDecoding:\n- ADX (All versions)\n- HCA (All versions)\n\nBuilding:\n- CPK (All CPK modes)\n- AWB (Anything)\n- USM (VP9 support only, ADX or HCA Audio support, multiple audio streams support as well, VP9/ADX only tested and for sure working!)\n\nEncoding:\n- HCA (HCA Version 2.0)\n- ADX (All versions, any bitdepth, any blocksize, any HighPass Frequence, All encoding versions)\n\n## Installation and Usage\nTo install run\n```\npython setup.py install\n```\nor alternatively\n```\npip install .\n```\n\nNote: all libs (except ADX) here are standardized to take either a filename/path or bytes/bytearray, so you can swap both.\n\nAlso, for audio related codecs, the looping input and output is defined in the metadata, the WAV file will not loop, but it will have a \"smpl\" chunk in the header, same if you want to encode a looping HCA or an ADX, the WAV must have a smpl chunk.\n\nOtherwise it will loop normally.\n\n### Usage:\n\n##### For ADX decoding and encoding:\n```python\nfrom PyCriCodecs import *\n# Decoding:\nadx_data = open(\"path_to_adx_file.adx\", \"rb\").read()\nwavfilebytes = ADX.decode(adx_data) # Decode will return bytes object containing decoded ADX data as a wav file.\n\n# Encoding:\nwav_data = open(\"path_to_wav_file.wav\", \"rb\").read()\nadxbytes = ADX.encode(wav_data) # Returns an ADX file as bytes, check the wiki for more options.\n```\n##### For HCA decoding and encoding:\n```python\nfrom PyCriCodecs import *\nhcaObj = HCA(\"filename.hca\", key=0xCF222F1FE0748978) # You can change the key, or remove it if the HCA is not encrypted. Key can be a hex string.\nwavfile = hcaObj.decode() # Gets you the wav file after decoding.\n\nwavObj = HCA(\"filename.wav\")\nhcabytes = wavObj.encode(encrypt=True) # and you will get an HCA file.\n# You can provide a key from when initializing, otherwise it will default to the default key, you can also encrypt keyless with keyless=true.\n# You can also force disable looping on HCA output by force_not_looping = True.\n\nwavObj.encrypt()\n# or\nhcaObj.decrypt() \n# Any works, given it can be decrypted or encrypted as an HCA. Would do it. You can also pass a key to \".encrypt()\", \".decrypt()\" uses the init key. \n```\n##### For CPK extraction and building:\n```python\nfrom PyCriCodecs import *\n# Extraction:\nCpkObj = CPK(\"filename.cpk\")\nCpkObj.extract() # Will extract files to a dir names \"filename\"\nCpkObj.extract_file() # Extract a file from a given filename (or an ID for CPKMode 0)\n\n# Building:\nCPKBuilder(\"dirname\", \"outfile.cpk\", CpkMode=1) # CpkMode is important sometimes, get your target mode by extracting a sample table. \n# Given a directory, it will take that directory as root, and builds a CPK for the directories and files inside.\n# Output would be a cpk file as specified.\n```\n##### For USM extraction and Building:\n-Note that USM building might be a little bit unstable due to bad code, feel free to open any issues if something did went wrong.\n```python\nfrom PyCriCodecs import *\n# Extraction:\nusmObj = USM(\"filename.cpk\") # or bytes, you can add a key by key=\"KEYINHEXGOESHERE\"\nusmObj.extract() # extracts all USM contents in the current directory. You can add a directory with extract(dirname = \"Example\")\n\n# You can also demux the USM internally and manage with the output bytes all you want.\nusmObj.demux() # Then you have access to output property.\nusmObj.output # This is a dict containing all chunks in the USM, each key has a value of a list with bytearrays.\n\nusmObj.get_metadata() # Not for the user specifically, but if you want to look at the info inside, this is one way.\n\n# Building:\n# Needs at least a video to be able to build one USM file, you can add audio pretty easily too.\nusmObj = USMBuilder(\"filename.ivf\", \"filename.wav\", key=0xKEYGOESINHERE, audio_codec=\"adx\", encryptAudio=True) # Basic USM\n# You can add a list of audio paths/filenames as well instead of filenames, and that will be added into audio streams in order.\nusmObj.build() # Due to bad code, this is heavy on performance and will take some seconds based of the input files.\nusmbytes = usmObj.get_usm() # Will return the USM file as bytes. \n```\n##### For ACB or AWB extraction:\n```python\nfrom PyCriCodecs import *\n# ACB Extraction:\nacbObj = ACB(\"filename.acb\") # It will attempt to open \"filename.awb\" as well if there are no sub-banks in the ACB.\nacbObj.extract(dirname=\"dirname\", decode=True, key=key) # You can turn off decoding by decode=False.\n# AWB Extraction:\nawbObj = AWB(\"filename.awb\")\n# You can either loop through the audios inside with:\nfor file in awbObj.getfiles():\n    file # file bytes.\n    open(\"file.hca or anything\", wb).write(file)\n\n# or you can call the extract function, not advised.\nawbObj.extract()\n```\n\nCheck the [Wiki](https://github.com/LittleChungi/PyCriCodecs/wiki/Docs-and-Thoughts) for my thoughts, plans, more options, and some details as well for documentation.\n\n## TODO List\n- Add ACB building.\n- Add correct ACB extraction.\n\n### Currently Known Bugs\n- USM Building is not stable, and currently does not work at all because I changed the ADX api.\n- Not important, and might not fix: ADX encoding and decoding at higher bitdepths (11-15) adds popping noise.\n- Some CPK's that has the same filename for every file in the entry will overwrite each other.\n- Probably many more I am unaware of, report if you find any.\n\n# Credits\n- [vgmstream](https://github.com/vgmstream/vgmstream) for HCA code.\n- [VGAudio](https://github.com/Thealexbarney/VGAudio) for ADX codec, and HCA encoding, both of which I ported into C++ but modified the ADX lib greatly.\n- [K0lb3](https://github.com/K0lb3) for helping a lot with python and Cpython, as well as helping me writing some of the code.\n- [bnnm](https://github.com/bnnm) for his various contributions on audio formats, helped me a lot with adding ADX and HCA support.\n- [Nyagamon](https://github.com/Nyagamon) for a lot of what he did for criware formats.\n- [donmai](https://github.com/donmai-me) and his [writeup](https://listed.to/@donmai/24921/criware-s-usm-format-part-1) of CriWare's UTF format.\n- 9th for also helping me with some python knowledge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoujose%2FCriCodecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYoujose%2FCriCodecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoujose%2FCriCodecs/lists"}