Questions tagged [pydub]

Pydub is a Python library for audio manipulation.

Pydub is a Python library for manipulating audio.

Quick links:

427 questions
0
votes
0 answers

Cannot seem to work with mp3 files in pydub

I have been trying to open mp3 files on pydub, I have ffmpeg in path and whatnot, but I get errors whenever I attempt to use pydub with mp3 files. Wav files work fine of course. This is my code for testing purposes (copied directly from…
0
votes
0 answers

how to split audio file due to the silences python

I have WAV file and I'm trying to use the silence of the audio to create dataset of audio's I use this code to split the audio sound = AudioSegment.from_file("/content/46.wav", format="wav") audio_chunks = split_on_silence(sound,…
0
votes
1 answer

Python cannot find a file that is definitely there

I am trying to upload an MP3 file and play it using pydub: import pydub from pydub import AudioSegment from pydub.playback import play blast_file = AudioSegment.from_mp3( …
0
votes
0 answers

AudioSegment after convert and Export, Double Duration after Exported in Mac Music

After I Converted it, if i click get info it shows the real duration ConvertFile = AudioSegment.from_file(fullPath, format=fileFormat) ConvertFile.export(fullPath,format=self.ExportFormat) But after I play it on MAC it doubles the playing time…
0
votes
0 answers

Why isn't silence placed in the output audio file with AudioSegment.silent?

The output of the file is unchanged from the source. I expect the following to mute the audio for a length of one second at two seconds into the audio file. Python version: 3.7 from pydub import AudioSegment audio_file = "input_audio.mp3" # Load…
ballade4op52
  • 2,142
  • 5
  • 27
  • 42
0
votes
0 answers

Why Do Librosa, PyDub and Tensorflow read the same mp3 differently?

I have downloaded the Kaggle Speech Accent Archive to learn how to handle audio data. I'm comparing three ways of reading mp3's in this dataset. The first uses Tensorflow's AudioIOTensor, the second uses Librosa and the third uses PyDub. I let each…
user1245262
  • 6,968
  • 8
  • 50
  • 77
0
votes
1 answer

How to get the peak of an audio file in python?

How could I get the dB value of the peak of a wav file (for example, the peak of some wav file could be -6db, aka its loudest point is -6db) using python?
prodohsamuel
  • 217
  • 3
  • 10
0
votes
0 answers

Match duration of two audio with each other by scaling the frame rate

from pydub import AudioSegment # Set the paths to the audio files file1_path = '1.wav' file2_path = '2.wav' # Load the audio files file1 = AudioSegment.from_file(file1_path, format='wav') file2 = AudioSegment.from_file(file2_path, format='wav') #…
shivam jha
  • 11
  • 4
0
votes
0 answers

How to create or hack the noise reduction model for audio processing python

I have been working on NLP project and Now I need to create Speech-to-text model for that but my dataset is noisy and I have to create the noise reduction to train my Speech-to-text model my go is to change some of this items optimization = { …
0
votes
0 answers

how to change some of audio default

I have wav file and I want to change some of the options from dic variable optimization = { 'amplify': '2.2 dB', 'bass': '9.0 dB', 'treble': '-1.0 dB', 'volume': '1.0 dB', 'speed': '0.98', 'high-pass': { 'frequency':…
0
votes
0 answers

Audio length not consistent between librosa and pydub

I am new to audio prosessing in machine learning. I processed a bunch of audio files and take one as example, I use pydub to make an audio file exactly to 6s as I expected using AudioSegment slicing or adding silence to modify the original audio…
0
votes
1 answer

Issue on rejoining splitted AudioSegment

I'm working on a script that splits an AudioSegment into 2 second sub segments and then rejoin them. The final purpose of this is to apply a transform function to each segment before rejoining them but at this point I'm just trying to rejoin the…
F P
  • 1
  • 1
0
votes
0 answers

split_on_silence values for detect breathing

I want to split a monolog parliement speech to segments sepereted by speeker's breeth. What are the suitable values for min_silence_len and silence_thresh? Thank you! I entered these values- audio_chunks = split_on_silence(sound,…
Hilla GB
  • 1
  • 1
0
votes
0 answers

Use Pydub to send audio to one of two sets of headsets

I have 2 sets of headphones connected to my laptop via an audio jack splitter. I am using Pydub in Python and I want to be able to play audio in one set of headphones at a time. I expected to be able to do this by using pan, assuming that the…
0
votes
0 answers

How to Convert MP3 audio file to 8, 24 or 32 bits in Python?

I have mp3 files that I'm trying to convert to 8, 24 or 32 bits, I was trying to do it using AudioSegment module using the following: audio = AudioSegment.from_mp3('audio.mp3') audio.resample(sample_width=1) which returns an error: AttributeError:…
Zack
  • 13
  • 4