[mpg123-users] libmpg123 opens non-mp3 files
Brought to you by:
sobukus
From: Martin G. <mar...@gm...> - 2023-12-19 19:40:51
|
Hi! I'm writing a soundfile visualization program that tries to open audio files first with libmpg123 then, is it fails, with libsndfile then, if that fails, with libav but I'm finding that libmpg123 "succeeds" in opening some files, wav and ogg, but the returns the file length as 0.048 seconds but fails to return any meaningful audio data. I'm doing mpg123_open() and mpg123_getformat() and, if either fail, falling back to the other libs. That was enough for one wav which it thought it could open but failed to get the format for, but foranother two both succeed, giving me garbage. Is this expected behaviour, and is there anything I can do better to detect that it's not an mp3 file? In case it's useful, the audio files in question are visible under martinwguy.net/test where "Renzo Arbore..." is the one where open() succeeds but get_format() fails, but with the other two both succeed. Thanks! M |