Metadata-Version: 2.1
Name: aacRepair
Version: 0.5
Summary: repair aac files
Author: René Horn
Author-email: rene_horn@gmx.net
License: MIT License
        ===========
        
        Copyright (c) [2022] [René Horn]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/44xtc44
Project-URL: documentation, https://aacRepair.readthedocs.io/
Project-URL: repository, https://github.com/44xtc44/aacRepair
Keywords: audio,aac repair,aacp repair,aacrepair,aacprepair
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Android
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Multimedia :: Sound/Audio :: Capture/Recording
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.rst
Provides-Extra: testing
Requires-Dist: pytest (>=6.0) ; extra == 'testing'
Requires-Dist: pytest-cov (>=2.0) ; extra == 'testing'
Requires-Dist: mypy (>=0.9.10) ; extra == 'testing'
Requires-Dist: flake8 (>=3.9) ; extra == 'testing'
Requires-Dist: tox (>=3.24) ; extra == 'testing'

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
