Questions tagged [pydub]

Pydub is a Python library for audio manipulation.

Pydub is a Python library for manipulating audio.

Quick links:

427 questions
1
vote
0 answers

Python: How to store 2 sound files overlapped with each other

I am trying to make a beat pad, for that I need to be able to play many sounds together, playing them together isnt the problem. What I cant figure out is how I can store the sounds played overlapped with eachother. For example, if I play a kick,…
Curran-C
  • 139
  • 1
  • 9
1
vote
0 answers

python - Play audio files like streaming music player

So I want to create a simple program like music streaming player using UDP socket protocol. So far, I can read the mp3 file, split it into some bytes, and send it continuously to my receiver (client). My problem is I want to play the mp3 file part…
Nicholas
  • 71
  • 9
1
vote
0 answers

MPEG-2 AAC frame-by-frame audio decoding

I have individual audio frames encoded in MPEG-2 AAC. Each frame consists of 1024 16 bit PCM samples. I notice that each AAC frame is a different size. I assume this is a result of the MPEG-2 AAC compression algorithm and perfectly normal. I need a…
jmkmay
  • 1,441
  • 11
  • 21
1
vote
1 answer

Is there a maximal length for pydub mp3 exports?

When I try to export long audio segments to mp3, I get an error OSError: [Errno 22] Invalid argument. The maximal acceptable duration seems to be somewhere between 202 and 205 minutes. The error and the code are below. Is there any way to be able…
Yulia V
  • 3,507
  • 10
  • 31
  • 64
1
vote
0 answers

How to set the highest bit rate to a flac output on Pydub?

I've trying to change the format of all my pack samples, from .WAV to FLAC. I made a script that checks all the subdirectories and finds file paths (WAV files specifically), and after find, it uses Pydub to convert the files. The problem is that the…
1
vote
0 answers

pydub cannot find *.wav file written by librosa

I'm using the Librosa function librosa.output.write_wav to output a time series as a .wav file and then trying to open it in pydub, but pydub is throwing a FileNotFoundError message (see below). The *.wav files are definitely in the same directory…
lashen
  • 31
  • 5
1
vote
0 answers

pydub export not working

I found this pydub example here on github : from pydub import AudioSegment from pydub.silence import split_on_silence sound_file = AudioSegment.from_wav("testsample.wav") audio_chunks = split_on_silence(sound_file, # must be…
Jurze
  • 209
  • 2
  • 11
1
vote
1 answer

Type Conversion from PyAudio str to AudioSegment returns errors

I'm working on creating an embedded compression system, similar to those found on professional audio mixers. I am capturing the audio samples using PyAudio via the given "wire" example. What's Supposed to Happen Those samples are sectioned into…
KSigWyatt
  • 1,368
  • 1
  • 16
  • 33
1
vote
1 answer

installed ffmpeg not detected. Can't convert audio (python 2.7, mac os x)

General information: I have a project in python that deals with audio classification; the backend is complete but I'm suffering with the front-end. The backend requirement (that I can't change) is that the audio file must be in wav format but I want…
trezcast
  • 31
  • 1
  • 9
1
vote
0 answers

Splitting audio segment by pitch

I'm trying to use Pydub to split an audio segment by pitch. My idea is to find the timestamps when the pitch changes and split according to those timestamps. The part I am stuck on is how to find the time when the pitch changes. Is there any way…
anticavity123
  • 111
  • 1
  • 9
1
vote
1 answer

AudioSegment.from_file fails if I specify 'wav'

This is a potential 'gotcha' which I'll document here in case anyone else trips over it. I'm running a conversion on files that may be in .wav or .mov format. The test looks like this: if pic[0].audiodesc.path.lower().endswith('.wav'): …
1
vote
1 answer

pydub - memoryerror

I am trying to split large podcasts mp3 files into smaller 5 minute chunks using python and the pydub library. This is my code: folder = r"C:\temp" filename = r"p967.mp3" from pydub import AudioSegment sound = AudioSegment.from_mp3(folder + "\\"…
CodeCupboard
  • 1,507
  • 3
  • 17
  • 26
1
vote
1 answer

When I try to open a wave file in pydub, it can't find the file. Why is this?

Here is what the terminal looks like: >>> from pydub import AudioSegment >>> song = AudioSegment.from_wav("E:\\sounds\\ahh.wav") Traceback (most recent call last): File "", line 1, in song =…
1
vote
2 answers

Wildcard filenames and Pydub

Can anyone explain to me how to fix this code. If I set song equal to the full file path my script runs without any problems. However, problem is I don't always know the name of the .mp3 file in that path, so I need to point to the file as a…
BrettJ
  • 1,176
  • 2
  • 17
  • 33
1
vote
1 answer

Increasing the playback speed of combined wav file in python?

I was trying to combine multiple wav files in python using pydub but the output song's playback speed was kinda slower than I wanted. So I referred to this question and tried the same. import os, glob import random from pydub import AudioSegment…
hashcode55
  • 5,622
  • 4
  • 27
  • 40