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
1 answer

Splitting 15-hour-long audio file into one-hour long files

I'm trying to split a 15-hour-long audiobook into shorter one-hour-long .mp3 files. Here's the function I made for this: from pydub import AudioSegment import re, os, math def process(fname, title): head_dir = title + ' (split)' if…
0
votes
0 answers

Conda install pydup failure

I have just started on Python. I am not able to install PYDUP in Conda. It gives PackagesNotFounderror for pydup. it lists current channels - win-64 and noarch in conda-forge.I am on conda 4.9.1
0
votes
1 answer

How to segment series of audio recordings according to onsets/offsets specified in dataframe (pydub/python)

I am trying to extract audio segments from a series of audio recordings. Segment onsets and offsets to be extracted from each recording are specified in a dataframe with three columns containing a) the name of the sound recording, b) the onset of…
HHH
  • 45
  • 4
0
votes
0 answers

Can't stop simpleaudio music using functions

So basically, I'm making a GUI that allows you to play music, I made a button that is supposed to destroy itself and stop music, but it only seems to destroy itself and the music keeps playing, no errors, no nothing. Code (Im only going to include…
user14279959
0
votes
1 answer

Why AudioSegment doesn't read 'mp3'?

I tried to read file that I give with absolute path. When I run my code first that I see is this message: D:\prog\datascience\anaconda\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but…
freshITmeat
  • 17
  • 1
  • 7
0
votes
0 answers

Convert multiple audio file formats in a folder and make a separate folder to store

I want to convert multiple audio file formats from a folder (named as "aud_test") to a unique WAV format using python 3. After this, Save all files in another folder (named as "re_test") as mentioned in the below code. import os …
Pikaschu
  • 11
  • 4
0
votes
0 answers

SimpleaudioError: Error opening PCM device

I want to use python to play certain muscial notes depending on some results I obteined erlier in my code. I'm using pydub and I downloaded some .wav sounds in my google colab document. However, I have an error that I can't quit figure out. Here's…
Marie
  • 1
  • 1
0
votes
1 answer

How to minimize memory usage while splitting .mp3 file into parts

I have a large .mp3 file (> 100 MB) that I want to split into parts less or equal 50 MB (for sending from Telegram bot). I solve this task by slicing the file into pieces of 50 minutes long. Test file: ~$ file /tmp/test.mp3 /tmp/test.mp3: Audio file…
0
votes
1 answer

Problem playing back audio with pydub with pyaudio's callback mode

I have a script that reads an audio media file with pydub and then outputs it to a pyaudio stream. Using the code below it plays through super quickly and I only hear snippets of the audio. I believe the issue is that pydub using milliseconds and…
Tom Haines
  • 21
  • 5
0
votes
2 answers

AttributeError: 'list' object has no attribute 'detect_nonsilent'

Running this snippet of code: while True: print('recording') myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=1, dtype=np.int16) sd.wait() # Wait until recording is finished write('output.wav', fs,…
Hankp
  • 47
  • 5
0
votes
1 answer

Accessing ffprobe with pydub

I'm trying to get https://github.com/jiaaro/pydub working with the ffprobe and ffmpeg decoders on Alpine Linux 3.7.3 in Docker. Error is: /usr/lib/python3.6/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe -…
KindOfGuy
  • 3,081
  • 5
  • 31
  • 47
0
votes
1 answer

Trouble with converting webm into mp3 with pydub in python

so basically I want to convert song what I downloaded from youtube in webm and convert to into mp3 when I wanted export song just with song.export("neco.mp3") it didn't work too I have in workfolder ffmpeg.exe and ffprobe.exe here is the code from…
rc_marty
  • 5
  • 1
  • 2
0
votes
1 answer

How to get similar results to pydub.silence.detect_nonsilent() using librosa.effects.split()?

I love pydub. It is simple to understand. But when it comes to detecting non-silent chunks, librosa seems much faster. So I want to try using librosa in a project to speed my code up. So far, I have been using pydub like this (segment is an…
Sinan Kurmus
  • 585
  • 3
  • 11
0
votes
0 answers

Pydub wma to mp3 fixing "library configuration mismatch"

Python novice, looking to change that. I am trying to convert a song from wma to mp3 while keeping the metadata on the song. Here is my code. #musicproject.py import os import glob from pydub import AudioSegment music_dir…
Rich
  • 1
0
votes
1 answer

How to apply a gain on a specific part of an AudioSegment?

I would like to change the volume of a music track but only for specific time ranges. For example, I would like to apply a gain of -6dB between 0s to 1s ; and between 5s to 6s and leave the rest of the soundtrack untouched. I have seen that I can…
Regman
  • 21
  • 3