> > So I created a file.wav and renamed it to 'file' just to confuse SoX. > > But it seems to recognize it as WAV just fine. > > > > Then I renamed it to file.mp3 to cause even more confusion. > > But SoX recognizes it as WAV all the same. > > > This is --without-magic. What exactly do we need it for? > Can someone more knowledgeable in the codebase please explain > when exactly is libmagic used to help SoX determine the a file format? > I guess that the file header has a field that says "wav" no matter what > filename extension you give it, or if you leave it away. > If that header would be missing as well, or would be corrupt or > otherwise faulty, I guess this is when libmagic would come in. No, libmagic works the other way round: it is precisely the presence of "RIFF$...WAVE" in the file that makes it recognizable as WAV by its content, regardles of name. What I meant is when does SoX use this? So far, my speculation is: if and only if sox --magic. ------------------------------------------------------------------------------ _______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users