dataflowg/g-audio

Feature Request: File Format Recognition

Closed this issue · 3 comments

Currently the library is checking for the file extension to identify the format.

But in some case an audio file may have a different file extension but the actual data might me of different format.

In this case the library will fail to load the audio file.

So it is better to scan the file headers (signatures) for the File Format details.

Here I have attached an example of implementing it.
image
Get Codec - copy.zip

This implementation is done in LabVIEW, if it is already available in the dll, it would improve the efficiency (by avoiding opening & closing of file).

File signature details can be found at https://en.wikipedia.org/wiki/List_of_file_signatures

Thanks for raising this issue, and for the example code and references. It was on my todo list :)

It will probably need to be implemented in the C++ code, so we can open files with unicode paths. In the event those file signatures don't exist (perhaps due to APEv2 tags), the function will fall back to the file extension method.

File signature detection has been added, and is applied when opening an audio file. A file's codec can also be queried by calling Get Audio File Info.vi. Thanks for raising the issue.

Nice to have it. Thanks for the update.