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

subprocess problem with PyDub: Python 3.63 v Python 3.10

Until recently I've been using python 3.63. When I need to use Pydub's audio_segment I do it like this to avoid a flash of the console when the app is frozen in a pyinstaller exe: subprocess.STARTUPINFO.dwFlags |=…
Edgar
  • 35
  • 5
1
vote
0 answers

python pydub generate audio file from keyboard presses

I've written a program to detect my keyboard presses and generate an audio file with pydub from this recording. When I inspect my two audio files (generated by python and recorded by smartphone) in audicity it's quiet obvious that the recording from…
Habebit
  • 957
  • 6
  • 23
1
vote
2 answers

How do I change the speed of an audio file in Python, like in Audacity, without quality loss?

I'm building a simple Python application that involves altering the speed of an audio track. (I acknowledge that changing the framerate of an audio also make pitch appear different, and I do not care about pitch of the audio being altered). I have…
1
vote
0 answers

FileNotFoundError when trying to split audio

I'm trying to split some audio files but I can't seem to find the solution for the error that occurs. I have imported pydub and AudioSegment. audio_file = AudioSegment.from_mp3(abs_path_file) This is the…
Luke
  • 31
  • 3
1
vote
1 answer

Playing audio in a remote Jupyter Notebook (like Google Colab)

I'd like to play audio on a remote Jupyter Notebook (like in Google Colab or a Binder-hosted Jupyterlab) but I can't figure out how. What I would like to get working is something like this: from pydub import AudioSegment from pydub.playback import…
ai4ki
  • 11
  • 2
1
vote
0 answers

An issue with reading files using Pydub AudioSegment

I am very new to Pydub library and having trouble with some functionalities. I'm trying to provide an audio file in same directory to the AudioSegment.from_file() function and it keeps returning this error, File "c:/Users/Win 10/Desktop/Final Year…
1
vote
2 answers

How to remove vocals so I can download only the instrumental of a song through python?

I am struggling with exporting a new audio file that only contains the instrumental of the song and no vocals. I'm currently attempting to run this bit of code: from pydub import AudioSegment from pydub.playback import play sound_stereo =…
1
vote
0 answers

Pydub library to find the loudest portion of an audio clip, save from 5 seconds before to 5 seconds after, and print out the max decibels?

I want to take m4a files from iPhones and use Python to find the max-decibel portion of the segment. I then want to trim the clip to start 5 seconds before, and end 5 seconds after the max-decibel point. Lastly, I want it to print out the decibel…
JapeHarf
  • 11
  • 1
1
vote
1 answer

I am not able to export audios on my desired folder processed by pydub

I am working on a script that split audios by 1 second, which performs its task well until i try to export all those files on different directories rather than source file directories, how can I make this script export file wherever I want. from…
1
vote
0 answers

How to shift audio half a hop length?

So I have a deep neural network that generates features from audio like w2v2 (wave2vec 2). They get trained for a long time and resulting nets have some constant feature generation rate. I also happen to be able to generate Mel spectrograms, yet for…
DuckQueen
  • 772
  • 10
  • 62
  • 134
1
vote
1 answer

Setting rms relative to another audio file using Pydub

I'm trying to set the rms level of an AudioSegment in Pydub relative to another file, before overlaying the two. The method I'm trying to use involves setting the relative rms of the first file to be +4 dB more intense than the second- I know rms…
Tom
  • 15
  • 5
1
vote
0 answers

Concatenating audio always leads to damage in quality

I'm trying to combine a long list of audio clips from Amazon Polly using python. Originally I used ffmpeg and os. st= 'ffmpeg -loglevel quiet -i sound1.mp3- i sound2.mp3 -i sound3.mp3 -i sound4.mp3 -filter_complex [0:0] [0:1] [0:2] [0:3]…
Glitchin
  • 21
  • 4
1
vote
1 answer

Trimming audio returns empty files (Python)

I'm trying to trim multiple .wav files considering different starting points (seconds), however the code I made returns only empty files. Here is the code considering two files with two different starting points: from pydub import…
PSCM
  • 85
  • 11
1
vote
0 answers

FileNotFoundError: [WinError 2] The system cannot find the file specified- MP3- to WAV conversion

I am trying to convert .mp3 format file to .wav format file using following code: from pydub import * input_file = "input.mp3" output_file = "result.wav" sound = AudioSegment.from_mp3(input_file) sound.export(output_file, format="wav") the file is…
Moazam Shahid
  • 137
  • 1
  • 1
  • 5
1
vote
2 answers

PySImpleGUI -> How to play audio in the Background

I'm using PySimpleGUI for creation of a simple program where a music should be played in the background of the GUI, but the problem is that Audio is played first and after that only the GUI appears, Is there any method to solve this Issue ? Here I'm…
SimpleGuy_
  • 443
  • 5
  • 12