Re: [mpg123-users] libmpg123 opens non-mp3 files
Brought to you by:
sobukus
From: Guido J. <Gui...@GM...> - 2023-12-19 21:58:21
|
Dear Martin, I would like to suggest to use the 'file' command to detect the MIME type of the audio files first. E.g. $ file -bi Renzo\ Arbore\ \&\ Lino\ Banfi\ -\ E\ La\ Candela\ Va\ \(1990\).wav audio/x-wav; charset=binary Guido On 19.12.23 20:40, Martin Guy wrote: > 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 > > > > _______________________________________________ > mpg123-users mailing list > mpg...@li... > https://lists.sourceforge.net/lists/listinfo/mpg123-users |