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 join multiple mp3 files?

Reading other questions I was wondering how to join multiple mp3 files like this. I tried this code but I'm getting as an output just the 2 latest mp3 files in the output.mp3... The expected output should be all the files into 1 mp3 file. from pydub…
user12154004
1
vote
1 answer

AudioSegment to Librosa

i,m writing a code using pydub module to get data from an audio file , but i want to do the same actions using librosa module , how to convert my code and get the same result with librosa here's my code : import numpy as np from pydub import…
noob
  • 11
  • 2
1
vote
1 answer

Using pydub on AWS lambda

Ok, so I have the same problem as here: Using pydub and AWS Lambda but thought it would be cleaner to re-ask here as I have made some progress (I think?). I followed the instructions here:…
Martin Harrison
  • 145
  • 2
  • 11
1
vote
1 answer

How do you add pydub (and eventally ffmpeg) and to the python path in Windows?

I'm relatively new to messing around with audio in Python, so I'm trying to set up for it. I need to add pydub to Python path, and I have no idea how to do it. Please help. Also, ffmpeg keeps crashing when I try to run it, and I don't know what to…
KReuZ_o13
  • 11
  • 4
1
vote
1 answer

How to increase or decrease the volume in dB of a sound in realtime (pydub)?

I research a way to change in realtime the volume of a sound that I am playing (with sounddevice or with pygame.mixer. I could just use the pourcentage volume of pygame.mixer.Sound.set_volume() but I have a huge problem, as it seems like it almost…
TrissN
  • 35
  • 8
1
vote
1 answer

How to detect a floating point audio file

I'm working with pydub to check bit_depth and framerate from audio files (wav and flacc). How I can verify if its floating point? https://en.wikipedia.org/wiki/Audio_bit_depth#Floating_point I've tried to check the type of sample_rate from pydub,…
Ramon Medeiros
  • 2,272
  • 2
  • 24
  • 41
1
vote
0 answers

How to split audio file when the sound changes?

I am using python (pydub) and I am trying to split an audio file when the sound changes and the sound is uniform. I really hate to post entire code but I have tried multiple options but without any success. In this method, it cuts but it will…
1
vote
1 answer

M4a (mp4) audio file encoded with pydub+ffmpeg doesn't play on Android

I have a python script to split up some wav files and export to m4a using pydub. I'm able to get these files to play on several devices, but not on an Android device (using Google Pixel 3). When I try encoding with straight ffmpeg in terminal,…
Evelyn
  • 2,588
  • 3
  • 22
  • 47
1
vote
0 answers

pydub export is not accurate

For testing purposes I wanted to create an mp3 file with pure sin-waves so I can check that my FFT is working properly. The following code creates this array of 1 and 0,5 seconds of sinewaves: sample_rate = 1 / 48000 x = np.linspace(0, 1, 48_000) y0…
Jonathan R
  • 3,652
  • 3
  • 22
  • 40
1
vote
1 answer

Format a pandas object column

I have a pandas DataFrame where one of the columns is filled with Pydub AudioSegment objects. I can display a single AudioSegment as an HTML audio player by just doing this in a cell: from pydub import…
Vinay
  • 469
  • 3
  • 14
1
vote
3 answers

Trying to iterate through .wav files in a directory (Python)

I'm trying to iterate through a directory that contains a list of wav files as shown below: My goal is to go through each wav file and add it to a wav file called transcript.wav which is located inside its parent directory. For example, the output…
Nahuel Mel
  • 51
  • 8
1
vote
0 answers

pydub cannot find ffprobe despite whatever solutions I tried

This is a very similar question to this Pydub unable to locte ffprobe however after following the solution, it still doesn't work :| I have FFmpeg in path for environment variables as well. my current code is just a simple one to let myself…
Wei
  • 31
  • 1
1
vote
2 answers

PyDub : Can't Save file in a different directory properly

I have been using this code to convert 10 .wav files in .mp3 song_dir = 'Desktop/Song_test/*wav' song = glob(song_dir) print(song) for song in song: mp3_song = os.path.splitext(song)[0] + '.mp3' sound = pydub.AudioSegment.from_mp3(song) …
Astrian_72954
  • 411
  • 2
  • 11
1
vote
1 answer

How can i increase the volume of a byte array which is from pyaudio in python

I am streaming audio from a mic to my speaker. But I want to increase the volume of the sound live but I can;t figure out a way and I've searched google for a while. Her Is my code import pyaudio Chunk = 1024 AudioFormat = pyaudio.paInt16 Channels…
WS Pham
  • 21
  • 1
  • 5
1
vote
1 answer

.raw to .wav via pydub(AudioSegment) sounds noisy

I want to convert .raw audio file to .wav audio file. So, I use below code with pydub AudioSegment final = AudioSegment.from_file('input.raw', format='raw', frame_rate=8000, channels=1, sample_width=1).export('result.wav', format='wav') btw, its…
dmjeong
  • 101
  • 2
  • 7