Skip to main content

audioperm

Audioperm, a python library for generating different permutations of audible segments from audio files.

License Package version License Open In Colab


Audioperm

A python library for generating different permutations of audible segments from audio files.

pip install audioperm

Use:

  • Silence Removal from Audio
  • Audio / Speech augmentation
  • Word segmentation
  • Word level permutation generation
  • Add new synthetic data for deep learning
  • Speaker recognition, Speaker verification, Audio classification, Audio fingerprinting

Documentation: https://zabir-nabil.github.io/audioperm/

Source Code: https://github.com/zabir-nabil/audioperm


Word segmentation

from audioperm import AudioPerm
from audioperm.utils import save_audio

ap = AudioPerm("i_love_cats.m4a")
label = "i love cats"

words = ap.word_segments()
label_words = label.split()

for i, w in enumerate(words):
  save_audio(w, label_words[i] + ".wav")
cats.wav  i_love_cats.m4a  i.wav  love.wav

Word-level permutation

import numpy as np
from audioperm import AudioPerm
from audioperm.utils import save_audio

ap = AudioPerm("i_love_cats.m4a")
ap.word_segments(return_words=False)
perm_sentences = ap.permute(n_permutations = 5)

for i, s in enumerate(perm_sentences):
  save_audio(s, f"perm_{i}.wav")
cats.wav	   i.wav       perm_1.wav    perm_4.wav
i_love_cats.m4a    love.wav    perm_2.wav    perm_0.wav  
perm_3.wav

permutations on multiple files

from audioperm import read_audio, word_segments, permutations

ap = read_audio(["bangla_demo.wav", "i_love_cats.m4a"])
out = word_segments(ap)
perms = permutations(out, n_permutations = 5)

Fixed-length segments

  • Generate fixed length audible segments (with permutation/augmentation)
from audioperm import fixed_len_segments
fixed_len_segments("bangla_demo.wav", return_segments = False, save_path = "fls_out", save = True, segment_size = 0.5)
out = fixed_len_segments("bangla_demo.wav", return_segments = True, max_segments = 5, permute = True, save = False, segment_size = 0.5)

Others

To run the code: Google Colab

Any contribution is welcome.

Tested with:

  • python3.7
  • python3.8

Internal audio representation:

  • PCM 16
  • float32

TO-DO:

  • multi-channel audio
  • augmentation
  • multi-processing
  • gpu-support

Metadata

Release files for audioperm 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audioperm 0.0.5
File Size Uploaded Provenance Actions
audioperm-0.0.5.tar.gz 6.9 kB Without provenance Details for audioperm-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for audioperm 0.0.5
File Interpreter ABI Platform Actions
audioperm-0.0.5-py3-none-any.whl Python 3 none any Details for audioperm-0.0.5-py3-none-any.whl

Total release size: 15.2 kB

Release files / audioperm-0.0.5.tar.gz

Download URL audioperm-0.0.5.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
446842ff423197f255e009628ffb58db2485d9509c6761a351b2769651bc737f
BLAKE2b-256 checksum
How to use checksums
8850b59cc5f3fcb14c2316d6cc5da2cc1f1bf9b83f7f3cd0d0e7405a4235c0bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.13

Release files / audioperm-0.0.5-py3-none-any.whl

Download URL audioperm-0.0.5-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc4a48a7aeb81f3900c5851fa1c849572d087a021872dea4b8f3a9a701c06aaf
BLAKE2b-256 checksum
How to use checksums
e624f5fdaf518f68d1ad1363c3d6a8989581d16145a60977cfa4a933a3af3ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.13

Security for audioperm 0.0.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page