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
2 answers

FileNotFoundError: [Errno 2] No such file or directory: 'Interview-part2.mp3' - pydub

I am trying to convert a .mp3 file into a .wav file based on [this website][1]. I have set my working directory to the location that stores both the python script and the .mp3 file, and tried running the code below: from os import path from pydub…
Emil
  • 1,531
  • 3
  • 22
  • 47
0
votes
0 answers

Lag sound error while playing 2 files with pyaudio and pydub

main.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt5 UI code generator 5.15.2 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not…
Chris P
  • 2,059
  • 4
  • 34
  • 68
0
votes
2 answers

Why I can't use "play()" function in PyDub?

I just wrote simple code to play some music, using PyDub module in Python: from pydub import AudioSegment from pydub.playback import play audio1 = AudioSegment.from_wav("music.wav") play(audio1) But I get this error: Traceback (most recent call…
0
votes
1 answer

Pyaudio with silent segments

I am trying the following code: import pyaudio from pydub import AudioSegment,generators import time silence = AudioSegment.silent(duration=125,frame_rate=32768) sine_data = generators.Sine(1000).to_audio_segment().raw_data chunk_number = 0 def…
Chris P
  • 2,059
  • 4
  • 34
  • 68
0
votes
0 answers

Split Mp3 in same sized chunks without saving/export them

Hello I want to split an AudioSegment into chunks that are all 10 seconds long. I tried it like this: for n in range(int(duration/10)): start = n*1000*10 end = (n*10+10)*1000 audio_segment = audio[start:end] The problem is now that i…
0
votes
0 answers

Read/Manipulate data from an audio file and write it to a new audio file

For this question I'm looking less for specific code and more for pointers and recommendations. What I'm doing is custom enough that asking for code samples seems unfair. I want to take the amplitude data from an audio track and use it to modulate…
Dr-Zee
  • 103
  • 1
  • 7
0
votes
2 answers

PyDub OSError: [WinError 6] The handle is invalid

I'm having a similar issue on Python 3.8.7, and I can't find the solution. In my project, I'm using pydub.AudioSegment to get audio from a file and then exporting that audio in a different format. My code works perfectly when I'm running the python…
SevaOle
  • 75
  • 1
  • 6
0
votes
1 answer

pydub.AudioSegment.from_file not finding file

Hi I am trying to use Google Web Speech API for Speech Recognition, I want to convert a audio file to text. I have been able to compile this code on my raspberry pi 4 but when I compile it on my Windows computer I get an error of file not…
braindead
  • 13
  • 3
0
votes
1 answer

split audio file into parts but i need to use these files in speech recognition

i am facing problem in google speech recognition about long audio file .. so i decided to split my audio file in 15 sec .. each time i send first 15 sec to speech recognition then the second 15 sec and so on ... but now when i use pydub lib it split…
0
votes
0 answers

How to export large audio files with pydub python?

I'm trying to export an audio file with pydub. I did it in a mp3 format, however it was really slow. Then I found out that using a wav format can make the process faster, but the size of the output file will be…
Karp
  • 431
  • 1
  • 6
  • 16
0
votes
1 answer

pip installs modules for python 2.7

I want to install a module with pip, in my case pydub. However pip install pydub installs pydub in /home//.local/lib/python2.7/ So when I run my script python3 myScript.py it tells me ModuleNotFoundError: No module named 'pydub' How do I get…
antimatter
  • 63
  • 1
  • 10
0
votes
3 answers

Can't figure out why PyDub is not working

I'm trying to use pydub for a music project, but when trying to play sounds with this chunk of code from pydub import AudioSegment from pydub.playback import play sound = AudioSegment.from_wav("s1.wav") play(sound) i get the following…
0
votes
0 answers

Couldn't find ffmpeg or avconv on linux server

I installed ffmpeg and pydub successfully on my linux server. And test with python environment ok. But when i running my code on nginx + gunicorn + django, its alert with error /home/www/env/lib64/python3.8/site-packages/pydub/utils.py:170:…
0
votes
1 answer

Pyaudio mix mp3 files with microphone

Pydub documentation I am trying to mix 2 mp3 files with microphone input using pydub and pyaudio. Here is what i have done: from pydub import AudioSegment from pydub.playback import play sound1 = AudioSegment.from_file(r"ΑΓΙΑ…
Chris P
  • 2,059
  • 4
  • 34
  • 68
0
votes
1 answer

Python silence specific part of audio file

I have an audio file audio.wav and I have an array of time frames looking like this one: X = [(12.31, 14.), (15.4, 18.9), ...] These are the time frames that I would like to be completely silent in a .wav audio file that I have. How can I achieve…
Petar
  • 195
  • 2
  • 14