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

How to force to a class?

I've made this class: class AudioSegmentCustom(AudioSegment): def fade_override(self, seg, fade_len=100): seg1, seg2 = AudioSegment._sync(self, seg) final = seg1[:-fade_len] a_fin = seg1[-fade_len:].fade(to_gain=-120,…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
1
vote
0 answers

Unpickling a python dictionary in a background process

I have written a python script similar to the shazam app. It captures 15 seconds of audio, and then tries to guess what song in the database it corresponds to. I have stored our database of songs (a dictionary of dictionaries where each key…
user3501476
  • 1,095
  • 2
  • 14
  • 26
1
vote
2 answers

FileNotFoundError trying to get mp3 file

I'm trying to use pydub to convert uploaded mp3s to a certain bitrate, using this code: from pydub import AudioSegment def process_mp3(mp3, id): print(mp3) # media/track1-original audio = AudioSegment.from_mp3(mp3) bitrates = [128, 192,…
Sebastian Olsen
  • 10,318
  • 9
  • 46
  • 91
1
vote
1 answer

Pydub for python 2.7 [windows 7]

How do I download and install pydub module to use in Python 2.7 on Windows 7 machine? What I found was the instructions for UNIX users only. [I want to concatenate two audio files (.wma). I found no solution code using the built-in modules so I…
qwerty
  • 13
  • 1
  • 7
1
vote
0 answers

Pydub of Python doesn't work-Probably ffmpeg installed wrongfully

I have recently downloaded and installed Pydub but it doesn't work. I installed it with pip and then downloaded and installed ffmpeg. Whenever I try to import the library or write a simple code, I get this error message: RuntimeWarning: Couldn't…
bnounis
  • 11
  • 4
1
vote
1 answer

python how to change ending of code

Im trying to figure out how to edit the ending of this string: select_file = AudioSegment.from_(select_file) what I'm trying to make it do is for the format of the file selected (In this case, a .wav file), to change the AudioSegment to extract for…
John Doe
  • 126
  • 1
  • 3
  • 15
1
vote
1 answer

Bad quality after multiple fade effect with pydub

I would like to generate workout mp3 file with music in the background and instructions at some timing (ex. "push harder", "do another repetition !") I generate the instruction with pico2wave and assemble them with pydub. I do this : for…
axel584
  • 235
  • 2
  • 9
1
vote
1 answer

Python - retrieving value from function within another function, while not rerunning the original function

I'm writing a program that sequences music out of a bunch of stems differently each time. I now have a basic GUI with buttons that trigger resequencing, playing and bouncing of the track. So, on execution, the program triggers the resequencing…
Sebastian
  • 11
  • 1
1
vote
2 answers

pydub returning zero byte file when I try to export part of an Mp3

I'm sharing this for posterity, since I already figured out the answer. I'm trying to create preview snippets of MP3 files with pydub in Python, but when I ran the export the files were always zero bytes in size. example: from pydub import…
tom f
  • 370
  • 3
  • 16
1
vote
1 answer

Recreating Web Audio API GainNode behaviour

I am overlaying a bunch of audio segments, and want to be able to pass a tuple of values in the form of (1, 1, 1, 0.5, 0...) to my function, each number being a ratio that the volume of a segment should be scaled to. 0 should be absolutely silent,…
cryzed
  • 151
  • 1
  • 4
  • 7
1
vote
1 answer

Raise_child exception output

I'm attempting to get pydub to mix 2 audio wav files into a single wav file. Here is my current code: from pydub import AudioSegment sound1 = AudioSegment.from_wav("Test_1.wav") sound2 = AudioSegment.from_wav("Test_2.wav") # mix sound2 with…
Philip R.
  • 345
  • 3
  • 4
  • 12
1
vote
2 answers

How to generate wav with G.711alaw from a mp3 file using pydub library?

I am trying to generate a wav file with G. 711 alaw companding from a mp3 file using Pydub library. The wav file is getting generated but it is not resampled to frequency 8 kHz. I have tried following code: from_path = '/home/nikhil/Music/m1.mp3'…
Nikhil N
  • 4,507
  • 1
  • 35
  • 53
0
votes
0 answers

Is there a way to make PyDub's overlay feature quicker?

I have been working on an audio program that uses an audio object from "AudioSegment.from_wav," and I have been using that to overlay it with other audio, but it takes too much time even with 20~ WAV files. Any ideas? Already tried to fix problem.
Trolly
  • 1
0
votes
0 answers

Errno 13 Permission denied Python pydub

im trying to run pydub and audiosegment but i keep getting errno13 permission denied and i need someone to help me fix it here is image of the code you can see the error im getting in the image i didnt like other libraries but if you have…
0
votes
1 answer

Pydub: How to ave audio after convert it to aac?

I am using django admin form to recieve a audio input, and I am trying to convert it into aac format with pydub. I have installed ffmpeg in my system and also added pydub and ffmpeg-python as dependencies. Here is the django ModelAdmin: class…
suvodipMondal
  • 656
  • 10
  • 27