bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
676 stars 105 forks source link

[src/libmpg123/layer3.c:INT123_do_layer3():1771] error: part2_3_length (1920) too large for available bit count (1568) #402

Open tpierobon opened 9 months ago

tpierobon commented 9 months ago

I'm trying to read a chunk from a 5 min mp3 file using the following code:

import soundfile as sf

original_sr = 22050
start_frame = int(3*original_sr)
stop_frame = int(4.1*original_sr)
audio, sr = sf.read(mp3_path, start=start_frame, stop=stop_frame)

But i got this message:

[src/libmpg123/layer3.c:INT123_do_layer3():1771] error: part2_3_length (1920) too large for available bit count (1568)

Is there a way to ignore it?

bastibe commented 9 months ago

These messages come from inside libmpg123, which is inside libsndfile, called by soundfile. You can try opening an issue in either of these libraries and inquire about disabling the messages there. But the message is probably given for a reason, which is probably a defective MP3 file.