Skip to main content

repair aac files

Project description

aac Repair

repair aac and aacPlus files grabbed from the internet

Info

Aac files consist of multiple segments, frames. Each frame has a header and payload. Browser get stuck if aac file frame is defective and will not start to play or refuse to play next aac file. This will stop the entire playlist. File gets trimmed from head to tail, to remove defective frames. Cut off byte count is shown in the summary.

Usage

from aacrepair import AacRepair

# 'r' before a string tells the Python interpreter to treat backslashes as a literal (raw) character
aacRepair = AacRepair(r"F:\propaganda-podcasts")
aacRepair.repair()

Instantiate AacRepair class with two possible arguments, mandatory folder path and optional dictionary.

  1. No dictionary provided. Folder path is used as list to import files into a dictionary AND store repaired files.
  2. A dictionary of files is provided. Folder path is used to store repaired files. (best use on web server)

Web Server

  • endpoint converts uploaded files from file storage type to bytestream, use .read() function
    • web server gets not the file path, only file name - needs path to store repaired files
    • dictionary {file(n).aac: b'\x65\x66\x67\x00\x10\x00\x00\x00\x04\x00'}

::

files = request.files.getlist('fileUploadAcpRepair')
f_dict = {f: open(f, "rb").read() for f in files if f[-5:] == ".aacp" or f[-4:] == ".aac"}
aacRepair = AacRepair("/home/Kitty/aac_files", f_dict)
aacRepair.repair()

File System

  • List of files in folder is written to dictionary {file_name_key: file_byte_content_value}

::

aacRepair = AacRepair("/home/Kitty/aac_files")
aacRepair.repair()

pip install

""" Linux """
$ pip3 install aacrepair

""" Windows """
> pip install aacrepair

Uninstall

Python user:

  • find the module location
  • uninstall and then remove remnants

$ pip3 show aacrepair

$ pip3 uninstall aacrepair

Location: ... /python310/site-packages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aacRepair-0.6.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

aacRepair-0.6-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file aacRepair-0.6.tar.gz.

File metadata

  • Download URL: aacRepair-0.6.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for aacRepair-0.6.tar.gz
Algorithm Hash digest
SHA256 951204606f5eba11f31114aca11f584d7bba7567018c06afe14c07aca04b7e94
MD5 6581065dd5f72187691a1eed36dbe9d2
BLAKE2b-256 7b967dce227587610f2823540e1fa875979ddcff26eafc8d49027aa26d2873fb

See more details on using hashes here.

File details

Details for the file aacRepair-0.6-py3-none-any.whl.

File metadata

  • Download URL: aacRepair-0.6-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for aacRepair-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6e5bb916da7b7fcaaaaa1733fb7043b30bb1d0702ba562be07db0c80cf866f
MD5 19946e1f0d25d53aa009d185fc806d88
BLAKE2b-256 99555116943ccfc3fafcda428be4fbc94dec8497c49ddf40285c4c9346bb22f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page