Questions tagged [pydub]

Pydub is a Python library for audio manipulation.

Pydub is a Python library for manipulating audio.

Quick links:

325 questions
4
votes
2 answers

Using Multiprocessing to Batch Convert .wav to .flac (Python, Pydub)

So I have written a very simple Python 3 program to take all of the .wav audio files in the working directory and convert them to .flac. Don't worry about any assumptions it makes (like the .wav files being valid, output filenames already existing,…
jippyjoe4
  • 742
  • 4
  • 19
4
votes
1 answer

Process 24bit wavs using pydub

Im trying to write a basic program that picks 2 audio files at random, layers them, and writes it out as a new file. I'm using pydub and it all works, however the results are distorted. I suspect it's because from what I've learnt, pydub cannot…
timcorin
  • 59
  • 2
4
votes
1 answer

Python | pydub: how to load wav sample into pydub from np.array instead of a wav file?

How would I load an audio np.array file into PyDub library? Currently, I use AudioSegment.from_wav(file_path), but it is not convenient, if I already have the wav file loaded as a numpy array: sample_rate, wav_sample =…
Oleg Melnikov
  • 2,591
  • 1
  • 25
  • 56
4
votes
1 answer

How to get Pi-Phase from sound to get a destructive interference in Python

first: I don't know where to put this topic because it's an programming and sound-question. Please comment if it's at the wrong place. But this is my question: How can I load a sound into Python and create the "reverse-sound" of it. So when I play…
Noah Krasser
  • 1,031
  • 1
  • 14
  • 21
4
votes
1 answer

How to specify the output channel (left,right) with pydub?

I would like to see the same function found on pygame, channel.set_volume for pygame.mixer.sound. Example: import pygame pygame.init() sound = pygame.mixer.Sound(name_of_the_file) channel = sound.play() channel.set_volume(1,1) #That's what I…
4
votes
1 answer

Calculation of fft using python

By using wave in Python we can read .wav audio format and can calculate the frequency and power of a signal. But I want to calculate the frequency of .mp3 audio format directly. I've heard a little bit about Pysox. Is Pysox capable of reading frames…
user007
  • 371
  • 1
  • 4
  • 10
4
votes
1 answer

Concating a list of objects in Python for Pydub module

I'm attempting to join a list of wav files together into one audio file. So far this is what I have. I can't wrap my head around how to sum the objects together though since they are each an object. import glob, os from pydub import…
Kenny Powers
  • 1,013
  • 2
  • 12
  • 25
4
votes
1 answer

PIL/Pillow inverting transparency seemingly arbitrarily

I have Pillow 2.4.0 installed (both in a virtual env on OS X and on a Ubuntu 14.04 EC2). I wrote the following script to generate a visualization of a waveform (drawing some inspiration from Jiaaro). It uses the Pydub library to analyze the waveform…
lyell
  • 71
  • 6
3
votes
3 answers

Using pydub and AWS Lambda

Afternoon All - So I think the title does say most of it but here goes. I'm new to the land of AWS and Lambda and having all sorts of fun learning this. I'm working on a project were I want to automagically merge two files stores in S3. I found…
Richard
  • 75
  • 6
3
votes
1 answer

Synchronizing audio and animation in python

I've written code to load an audio file, calculate the frequency spectrum, and animate it. I don't appear to have a way to synchronize the audio with the animation with the tools I'm using. The roadblock I'm hitting is that pydub doesn't actually…
Rob Hilton
  • 61
  • 6
3
votes
2 answers

Loading a File from Google Bucket into PyDub AudioSegment

I have been trying for a while to load a .mp3 file which exists in a Google Bucket into Pydub. Here is my code f = io.BytesIO() storage_client = storage.Client() bucket_name="my-bucket" bucket = storage_client.get_bucket(bucket_name) blob =…
3
votes
1 answer

How to split a single audio file into multiple files?

I want to split a single audio file into multiple audio files using python and save them, the peaks in file is separated by silence. The audio file contains 5 A's The waveform is given below: I have tried librosa library and pydub codes for the…
3
votes
3 answers

How to fix FileNotFoundError: [WinError 2] The system cannot find the file specified with AudioSegment.from_mp3()

I've been trying to find the position of spaces of audio silence in the audio of a video, but I can't get past just importing an audio file with pydub in python 3 I've already tried changing the directory that pydub is checking for ffmpeg to one…
jah
  • 31
  • 1
  • 3
3
votes
4 answers

How to change audio playback speed using Pydub?

I am new learner of audio editing libs - Pydub. I want to change some audio files' playback speed using Pydub(say .wav/mp3 format files), but I don't know how to make it. The only module I saw that could possibly deal with this problem is speedup…
itsMe
  • 53
  • 1
  • 6
3
votes
0 answers

unable to split audio using split_on_silence()

I've tried multiple combinations of min_silence_len and silence_thresh but it always returns chunk of length 1. Unable to understand, what am I missing ? import speech_recognition as sr from pydub import AudioSegment from pydub.silence import…
1 2
3
21 22