Add auto File type detection

Issue #29 new
IJabz repo owner created an issue

In the current release AudioFileIO uses the provided file's extension to guess which concrete AudioFile implementation should be returned to the caller.

It would be really useful having two other options: 1. one that determines the concrete AudioFile impl. to be returned based on the magic-number exposed by the file (the extension cannot be always available) 2. another API that accepts a mime-type provided by the caller, according to which the most appropriate AudioFile is provided

I require this as I'm storing audio files of various formats using a SHA-1 identifier e.g. /some/path/2f/d4/e1c67a2d28fced849ee1bb76e7391b93eb12

This is best practice approach for mass file storage to provide a form of data integrity and remove the requirement to sync database and file system upon metadata in the db being changed. That metadata contains the mime-type and original extension which I can supply the AudioFileIO method along with the File instance to allow identification of the format.

Comments (1)

  1. Log in to comment