Questions tagged [pydub]

Pydub is a Python library for audio manipulation.

Pydub is a Python library for manipulating audio.

Quick links:

427 questions
36
votes
4 answers

How to create a numpy array from a pydub AudioSegment?

I'm aware of the following question: How to create a pydub AudioSegment using an numpy array? My question is the right opposite. If I have a pydub AudioSegment how can I convert it to a numpy array? I would like to use scipy filters and so on. It…
J_Zar
  • 2,034
  • 2
  • 21
  • 34
25
votes
7 answers

FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'

When running the code snippet, I get the error seen in the title. I have re-installed the package pydub,and pip3 install ffprobe. from pydub.playback import play from pydub import AudioSegment def change_volume(file_name,…
Kimchoo
  • 261
  • 1
  • 3
  • 5
24
votes
3 answers

Python convert mp3 to wav with Pydub

Ok, now I am stuck up in converting mp3 to wav. I have seen different answers but i think i would to go for the one of pydub, which i already did using these few lines from pydub import…
phourxx
  • 591
  • 1
  • 4
  • 15
21
votes
9 answers

Pydub (WindowsError: [Error 2] The system can not find the file specified)

I have a problem with Pydub module running in Windows and Linux. When I try open a mp3 file thus: from pydub import AudioSegment sound = AudioSegment.from_mp3("test.mp3") Console show me the next message: WindowsError: [Error 2] The system can not…
gasgen
  • 319
  • 1
  • 2
  • 14
20
votes
1 answer

How to create a pydub AudioSegment using an numpy array?

I have the following code in python from scipy.io.wavfile import read rate, signal = read('./data/input.wav') # get only one channel signal = signal[:,0] # do a bunch of processing here Now I want to create an pydub segment using 'signal' and…
Dayvid Oliveira
  • 1,157
  • 2
  • 14
  • 34
18
votes
5 answers

FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

I'm new in python and i'm using pydub modules to play mp3 track. Here is my simple code to play mp3: #Let's play some mp3 files using python! from pydub import AudioSegment from pydub.playback import play song =…
stackoverflow
  • 197
  • 1
  • 1
  • 4
16
votes
1 answer

Generating Silence with pyDub

I've found pyDub, and it seems like just what I need: http://pydub.com/ The only issue is with generating silence. Can pyDub do this? Essentially the workflow I want is: Take all the WAV files in a directory Piece them together in filename order…
user3643227
  • 275
  • 2
  • 3
  • 8
15
votes
2 answers

Pydub - How to change frame rate without changing playback speed

I have a couple audio files that I open in Pydub with AudioSegment. I want to decrease the audio quality from frame rate 22050 to 16000 Hz. (One channel files) If I simply change the frame rate of AudioSegment, what I get is the exact same…
Daniel Möller
  • 84,878
  • 18
  • 192
  • 214
14
votes
5 answers

Pydub unable to locate ffprobe

Here is the link to a similar question to this: Pydub (WindowsError: [Error 2] The system can not find the file specified) Although in this one the problem is with ffmpeg, which I solved by setting the absolute path. After setting the absolute path…
Recessive
  • 1,780
  • 2
  • 14
  • 37
12
votes
1 answer

Playing audio in pydub

How can I play a wav audio after importing it to my code? from pydub import AudioSegment song = AudioSegment.from_wav("explosion.wav")
Amen
  • 1,524
  • 5
  • 22
  • 41
11
votes
3 answers

remove silence at the beginning and at the end of wave files with PyDub

How can I remove the silence from the beginning and the end of wave files with PyDub? I guess I should access segment by segment and check whether it's silent or not (but I'm not able to do it) :/ e.g. I have a wave file with silence at the…
DaniPaniz
  • 1,058
  • 2
  • 13
  • 24
11
votes
2 answers

Pydub concatenate mp3 in a directory

I would like to concatenate all .mp3s in one directory with pydub. The files are numbered consecutively file0.mp3, file1.mp3 etc. this code from the example code: playlist_songs = [AudioSegment.from_mp3(mp3_file) for mp3_file in glob("*.mp3")]…
digit
  • 1,513
  • 5
  • 29
  • 49
11
votes
1 answer

Using pyDub to chop up a long audio file

I'd like to use pyDub to take a long WAV file of individual words (and silence in between) as input, then strip out all the silence, and output the remaining chunks is individual WAV files. The filenames can just be sequential numbers, like 001.wav,…
user3643227
  • 275
  • 2
  • 3
  • 8
10
votes
2 answers

How to split the audio file in python

I'am working on Speech sentiment analysis on customer care data. I have an audio file where the customer care official has asked the question and the customer has given his review. I need to split this audio, and get only the review part from the…
Anagha
  • 3,073
  • 8
  • 25
  • 43
9
votes
1 answer

Read from bytes not filename to convert audio

I have small-sized sound files stored in MongoDB as BSON. Task is to retrieve Binary data from the database, convert it to an appropriate format and send back to the front end. The problem is with the converting. I have found pydub can be used for…
O. Barinov
  • 161
  • 1
  • 1
  • 12
1
2 3
28 29