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

pydub "ModuleNotFoundError" when using pyinstaller

I am trying to convert a .py file to .exe using pyinstaller. When I try to run the executable the following error is shown : My current pyinstaller command is the following: pyinstaller --noconfirm --onefile --console --hidden-import "pydub"…
Ventior
  • 207
  • 1
  • 10
0
votes
0 answers

'AudioSegment' object does not support item assignment

I have one big wav file: from pydub import AudioSegment big_aduio_file= "movie.wav" audio = AudioSegment.from_wav(big_aduio_file) And from it, I make a slice: start = 6800 end = 10000 audio_chunk=audio[start:end] Then, After I done a lot of…
TheGainadl
  • 523
  • 1
  • 6
  • 14
0
votes
1 answer

pydub - Invalid data found when processing input

I'm trying to learn how to transcribe an audio recording, but I'm not getting very far, pydub won't even accept my recorded data: from pydub import AudioSegment m4a_file = '{path_to_m4a}/test.m4a' sound = AudioSegment.from_wav(m4a_file) This…
goose
  • 2,502
  • 6
  • 42
  • 69
0
votes
1 answer

Brackets was not closed even after it closed pylance

I just copy-pasted this code block which I want to use on my script but this throwing red mark by pylance saying "(" "[" "{" was not closed, but I cannot find where I missed those, everything looks perfect for me for idx, sentence in…
0
votes
2 answers

Unable to properly increment variable and convert to .wav to .mp3

I am trying to create a new file recording every time this program runs and also convert those .wav files to .mp3. When I run this, it only creates a output.wav and output0.mp3 file and then when I run it again, no further files are created. Also…
Student1860
  • 138
  • 2
  • 17
0
votes
1 answer

Volume slider in Tkinter with PyDub

Usually with audio you would access volume with: sound.volume = 10 However with Pydub, the volume is accessed using: sound + 10 The problem with this as I cannot exactly 'set' the volume, just adjust the volume that the song is currently at. I would…
0
votes
1 answer

How to merge/layer two audio files using Python AudioSegment without it breaking the wav header

I am more or less following the code below to merge two audio files. It mostly works, where audio segment can export both the original files and the combined file to a folder. These play fine in finder (Mac). However, when brought into a music app…
tambourine
  • 89
  • 1
  • 5
0
votes
0 answers

Removing white noise and static from streamed audio file in python

I'm consuming a live audio stream from a websdr via a websocket by running a generator function which grabs chunks of the audio stream and saves those chunks into a wav file. The problem is that the generated audio file contains a ton of noise…
Matthew
  • 411
  • 6
  • 22
0
votes
1 answer

PyDub AudioSegment fails to load valid file

I use Python to manipulate WAV files. This code used to work: from pydub import AudioSegment fp = "/Volumes/.../generic.wav" sound = AudioSegment.from_wav(fp) And now I get this error: Traceback (most recent call last): File…
miguelmorin
  • 5,025
  • 4
  • 29
  • 64
0
votes
0 answers

How to use "exec" with pydub overlay without creating "none" filetype?

I'm trying to use pydub to combine multiple audio files. When I create a string and then try to exec that while assigning it to a variable it doesn't work and the variable returns a 'none' type error when I try to export the audio. from pydub…
jtbuddha
  • 1
  • 2
0
votes
1 answer

Pydub installation problem - ModuleNotFoundError: No module named 'pydub'

I need an automatic speech transcription tool for my video editing project. I am using python speech recognition library. To split big audio file into small fractions I installed pydub and added its functionality in my script. Although I checked and…
0
votes
0 answers

The filename, directory name, or volume label syntax is incorrect:

I have been trying to create a desktop application that converts mp3 files to wav. However, when ever I choose a file I always receive the a filename error. Can someone help me? file_path = askopenfilenames() p =…
Bob Doe
  • 1
  • 1
0
votes
1 answer

I can not focus this song on one of my ears with pydub

I wrote this code with pydub. I want to make to different variables with the same song. One song would just play in the left ear and one song would just play in the right ear. from pydub import AudioSegment src = "or_test.mp3" dst1 =…
0
votes
0 answers

How do I insert an audio into another audio file at a particular time using python?

I want to merge two audio files but want some interval between them and end result should be a .wav file, How do I do that? I don't want to overlay the sounds...
0
votes
0 answers

What does each element in the NumPy array derived from the Pydub audio segment represent?

I'm quite new to audio processing. Lately, I'm trying to use audio data to control the virtual lightbulb (implemented by a simple python Turtle) with the assumption that each element in the Numpy array represents the amplitude of the audio at the…
SorawitC
  • 23
  • 5