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
1 answer

Pydub trim and fade not working correctly

I have a audio file as mp3. And I want to trim it with fade-in and fade-out. So my code snipped like that: from pydub import AudioSegment files_path = '/Users/User/Desktop/audioFade/audios/' file_name = '03 Mana' startMin = 0 startSec = 0 endMin…
akasaa
  • 1,282
  • 4
  • 13
  • 33
1
vote
5 answers

PermissionError: [Errno 13] Permission denied when trying to play mp3 with python

I'm trying to play an mp3 with pydub, and I keep getting the error File "c:\Users\ryanc\Desktop\codefiles\python\audio player.py", line 5, in play(song) File…
sunatdoc
  • 21
  • 2
1
vote
1 answer

Python Pydub.AudioSegment boosting volume doubles track length

I wrote a bit of code to boost song volume, the volume boosting bit is as follows: song = AudioSegment.from_mp3(preboostSong) louder_song = song + decibels louder_song.export(p.strip(".mp3")+"_louder.mp3", format='mp3',tags=mediainfo(p).get('TAG',…
Clack Hack
  • 21
  • 2
1
vote
0 answers

pydub how to filter out any sound below a certain threshold

I have recorded two people speaking on two different channels. However, they are close enough that you can hear both people on both channels albeit at different volum. I used pydub to split this into second long intervals and display the dBFS. It's…
user1357015
  • 11,168
  • 22
  • 66
  • 111
1
vote
4 answers

How can I hide 'pydub' output information?

My Code from pydub import generators from pydub.playback import play play(generators.Sine(440).to_audio_segment(duration=1500)) In the console output: Input #0, wav, from…
Birkan
  • 121
  • 2
  • 9
1
vote
0 answers

Real time audio processing with python and AudioSegment

Well for some reason i want to split some selected mp3 files to chunk-time: ~28msec. I have quality problem for slicing<1sec. from av import AudioFrame from pydub import AudioSegment import av #open an mp3 file sound1 =…
Chris P
  • 2,059
  • 4
  • 34
  • 68
1
vote
1 answer

Mix audio files make clipping on python

I have some audio files. I mixed audio files. for idx,f in enumerate(files): if idx == 0: sound = pydub.AudioSegment.from_file(f) else: temp = pydub.AudioSegment.from_file(f) sound = sound.overlay(temp, position=0) …
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

Pydub playback from queue

I'm working with audio processing for my program and need to implement a simple monitor playback. To do "realtime" processing all pydub.AudioSegments are sliced into 20ms chunks before they are sent down the machinery. At the end the segments sent…
Reverend
  • 11
  • 1
1
vote
1 answer

How to determine theoretical filesize of converted audio file without actually converting (i.e. mp3 to wav)

Background: I am writing a python script that will take in an audio file and modify it using pydub. Pydub seems to require converting audio input to a wav format though, which has a 4GB limit. So I put in a 400MB .m4a file into pydub and get an…
John G.
  • 47
  • 1
  • 8
1
vote
1 answer

How to pad multiple audio wav files with silence

I am trying to pad audio wav files. I have found the code below. Could I get any help to apply this on multiple files with different names? from pydub import AudioSegment pad_ms = 1000 audio = AudioSegment.from_wav('sit.wav') assert pad_ms >…
1
vote
0 answers

Thread stops running when creating an AudioSegment from pydub

I'm creating an application that will play audio on a different thread. The thread runs fine until it reaches the statement where I create an AudioSegement from the pydub library. I want it to continue executing after this statement so that the…
PhonyStark
  • 21
  • 2
1
vote
2 answers

cannot import name 'FFProbe' from 'ffprobe'

Background: I have the following code, which should navigate to the mp3files dir on my mac and then convert all .mp3 files to .wav files. Code: import os from pydub import AudioSegment from ffprobe import FFProbe path =…
William
  • 191
  • 5
  • 32
1
vote
0 answers

Python stop pydub audio by killing thread

I'm coding a little sound player with python and I can't find a way to stop pydub audio during a sound.. I can't stop the thread by doing something like : class Player(Thread): #init method def run(self): sound =…
1
vote
1 answer

How Do I Load Audio into Pydub in the First Place?

I realize that this is a very, very basic question but I started learning Python yesterday so I can make a program I've had the idea for and I'm unable to find any information that would help me in over two hours of Google searches and forum…
LumaCurve
  • 11
  • 3
1
vote
2 answers

I have pip installed pydub but still didn't work

After I had pip installed pydub and SpeechRecognition, I still can't make the program run successfully although I extracted the files from ffmpeg and specified the folder name bin in the corresponding directory. I tried to find solutions to solve…
Dom807
  • 27
  • 7