Skip to main content

A small package to convert audio files

Project description

pyaudioconvert

Simple utility to convert audio from one form to another (via sox). We will use Sox until we find a fast and efficient way to convert reliably in python

Requirements

  1. At least py3x
  2. Have sox installed

Install

  1. pip install pyaudioconvert

Example Usage

Converting Single WAVs

#let's start with a 24bit 48kz audio wav 2 channel wav
>>> soxi example_24bit_48k_2ch.wav 

Input File     : 'example_24bit_48k_2ch.wav'
Channels       : 2
Sample Rate    : 48000
Precision      : 24-bit
Duration       : 00:00:04.00 = 192000 samples ~ 300 CDDA sectors
File Size      : 1.15M
Bit Rate       : 2.30M
Sample Encoding: 24-bit Signed Integer PCM

#we prefer 16-bit 16kz mono for our systems, let's use python
>>> import pyaudioconvert as pac
>>> pac.convert_wav_to_16bit_mono('example_24bit_48k_2ch.wav', 'example_16bit_16k_1ch.wav')
Out[2]: 'example_16bit_16k_1ch.wav'

#let's check the new file...
>>> soxi example_16bit_16k_1ch.wav 

Input File     : 'example_16bit_16k_1ch.wav'
Channels       : 1
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:04.00 = 64000 samples ~ 300 CDDA sectors
File Size      : 128k
Bit Rate       : 256k
Sample Encoding: 16-bit Signed Integer PCM

Converting Directory of WAVs

Maybe I have a whole folder of WAVS that need converting... this will create a _16k.wav version.


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

pyaudioconvert-0.0.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaudioconvert-0.0.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pyaudioconvert-0.0.4.tar.gz.

File metadata

  • Download URL: pyaudioconvert-0.0.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for pyaudioconvert-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f6212700e0309fa355e530dd4533d8242967fcba65a99b142f111dfc58fe2f21
MD5 0f15a2085b1cf6e4f36abe3e4ab78af8
BLAKE2b-256 a792c0d50f4d54946c30c692e68a12bff3d1440fbb9041f9535e2a78acee7b4f

See more details on using hashes here.

File details

Details for the file pyaudioconvert-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyaudioconvert-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for pyaudioconvert-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8ef839451c38d9b3766690d2624909eecd04919f3cedf4a8dd65dbec9626f4ad
MD5 be4ad8e0e718683efc92a0ae5b81d1e4
BLAKE2b-256 e366c46bd7637fbc3452da029aed59de21df55063354d702fc65f999c3384b84

See more details on using hashes here.

Supported by

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