G711 A-Law / u-Law audio-coding library
The library is written as an extension for python3 and allows to work simply with G711 encoded audio.
Requirements
- Python 3.5+
- Numpy (will be installed anyway before the building procedure)
- Tools for building C/C++ applications (GCC/Clang/VS build tools)
Implementation details
The library is written in pure C and relies exclusively on a python build system. I tried to minimize the use of any platform-dependend functions to provide a truly cross-platform and fast library.
Installation
Source distribution is uploaded to PyPI, so just invoke pip install g711. Equivalently, you can clone code from https://github.com/stolpa4/g711 and then run pip install <path to cloned repo>.
Functions
load_alaw(path: Union[str, os.PathLike]) -> numpy.ndarray(dtype=numpy.float32)- Opens a file, loads its contents and decodes it from A-Law to float32 numpy array.load_ulaw(path: Union[str, os.PathLike]) -> numpy.ndarray(dtype=numpy.float32)- Same for u-Law.save_alaw(path: Union[str, os.PathLike], audio_data: numpy.ndarray(dtype=numpy.float32)) -> bool- Encodes an array to A-Law and writes bytes to a specified file. audio_data can be anything convertible to numpy.ndarray(dtype=numpy.float32).save_ulaw(path: Union[str, os.PathLike], audio_data: numpy.ndarray(dtype=numpy.float32)) -> bool- Same for u-Law.decode_alaw(encoded_bts: bytes) -> numpy.ndarray(dtype=numpy.float32)- Decodes raw A-Law bytes to float32 audio.decode_ulaw(encoded_bts: bytes) -> numpy.ndarray(dtype=numpy.float32)- Same for u-Law.encode_alaw(audio_data: numpy.ndarray(dtype=numpy.float32)) -> bytes- Encodes an array to A-Law and returns bytes object. audio_data can be anything convertible to numpy.ndarray(dtype=numpy.float32).encode_ulaw(audio_data: numpy.ndarray(dtype=numpy.float32)) -> bytes- Same for u-Law.
Metadata
Release files for g711 1.6.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| g711-1.6.5.tar.gz | 8.5 kB | Without provenance | Details for g711-1.6.5.tar.gz |
Release files / g711-1.6.5.tar.gz
| Download URL | g711-1.6.5.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcde5490806c7b86b4a9634eb3fa888e9bbc8a54878338bf52383c1bf9f69996
|
|
BLAKE2b-256 checksum How to use checksums |
c11fc6cd74727bc30f2cb01727143f8bcbcf95f0e93dccce417a94aa2a85e218
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|
Security for g711 1.6.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.