Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pydub AudioSegment.from_file cut my audio by int16 value #752

Open
Sitcebelly opened this issue Sep 8, 2023 · 0 comments
Open

Pydub AudioSegment.from_file cut my audio by int16 value #752

Sitcebelly opened this issue Sep 8, 2023 · 0 comments

Comments

@Sitcebelly
Copy link

When i read the file with audioSegment it cut my audio by int16 value in most of the cases, how can I avoid this?

Read code

from pydub import AudioSegment
import numpy as np
import soundfile as sf

audio_path = "audio.mp3"
audio = AudioSegment.from_file(audio_path)
waveform = np.array(audio.get_array_of_samples())

sf_wav, sr = sf.read(audio_path)

Pydub audio
Screenshot 2023-09-07 at 20 28 58

Soundfile audio
Screenshot 2023-09-07 at 20 29 20

As you can see pydub cutted me audio by value 32767 - int16, How can i avoid it?

@Sitcebelly Sitcebelly changed the title Cut the highest amplitudes, by int16 Pydub AudioSegment.from_file cutted my audio by int16 value Sep 8, 2023
@Sitcebelly Sitcebelly changed the title Pydub AudioSegment.from_file cutted my audio by int16 value Pydub AudioSegment.from_file cut my audio by int16 value Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant