jiaaro/pydub

Pydub AudioSegment.from_file cut my audio by int16 value

Sitcebelly opened this issue · 0 comments

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?