Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Modules _ Windows 10 Flac Tags Bug

Posted by: RLG Jul 9 2019, 05:41 PM

Thanks to help from kind members here, I finally got my music database to import flac tags and insert them into a pretty form. I have been working on this DB for 11 years now, and it helps me to find everything I need among my 14,000 CDs.

BUT, as I received notification from Microsoft that they were phasing out Windows 7 support, I took the plunge and installed Windows 10. At the same time, being by nature adventurous, I also changed to Office 2019.

I have managed to get almost everything to work now, but Windows 10 has a known bug which curtails flac tags to the first x characters, which has screwed up my lovely module totally. And apparently there is no urgency to correct it, so I have to change the way I attack this.

Flac format, which is actually Vorbis, holds the tag information at the very beginning of the file, and so should not be difficult to parse. But I don't know how to import a flac music file into an Access table as text in ASCII format.

Please can someone help?

Posted by: DanielPineault Jul 9 2019, 05:44 PM

Any chance you can post a file and the expected extract?

What about

Posted by: RLG Jul 9 2019, 05:56 PM

Thanks for the quick response, Daniel.

Your suggested code is fine for any type of text file, but I need to read a .flac music file as text, in other word convert it.

It's the conversion method which has stumped me.


Posted by: DanielPineault Jul 9 2019, 06:11 PM

I'd need to see a file.

That said, why not use something like to get the data and get it from there?

Posted by: RLG Jul 10 2019, 03:06 AM

Thanks for the link, Daniel. I am investigating how I can invoke the command line editor under the control of VBA and import the results into a table.

In the meantime, here is a link to a typical flac file from my collection:!EBZhhAxJ!49yX_U4IS57BdhWU0TsBOs3j-r4nosTcsPdY-mkKla8. You can download this as-is without a password. I have about 200,000 of these.

This is a mid-size file of 92MB as an example. Some are much larger as they are in higher resolution flac.

As a point of interest, I use Notepad++ for quite a lot of coding, and it imports the flac files as text without problems, but of course metaflac should be able to identify the tags without my having to parse the whole header.

Much appreciate your help and suggestions.


Posted by: gemmathehusky Jul 10 2019, 04:10 AM

How much data do you need to read from the file. Is it a fixed amount or a variable? do you need to determine where the "header" ends? If so, how do you do this?

Can you give an example of what you end up with as a "header" from the sample file?

Posted by: RLG Jul 10 2019, 06:00 AM

This is the header in ASCII of the file I included:

fLaC "   P
Cp0iS2Y8 fHz  reference libFLAC 1.3.0 20130526
 COPYRIGHT=2015 Warner Classics TOTALTRACKS=091
Artist=Mischa Maisky (vlc), Martha Argerich (pno) Artist=Mischa MaiskyI
Title=Beethoven 7 Variations on Mozart's 'Bei Männern' in E flat, WoO 46
Album=Martha Argerich and Friends 2014 Disc 1
Genre=Classical DATE=2014 TRACKNUMBER=04
ALBUMARTIST=Martha Argerich and Friends Y_ 

There is no fixed length for the header, as there are additional tags which i have not used in this case. An example is COMMENT, which has no maximum defined length.
However, each individual tag is actually completed by three successive NULS, and the header (after the image, which is always last) is ended with a row of at least 10 NULS.

This whole file in Notepad++ is 753,242 lines long, which is why we need to parse out the very short header immediately.

The Metaflac utility which Daniel directed me to actually has an instruction to strip out the tags and export them to a text file, so that way would be the easiest if I could find out how to control it in VBA.

Thanks for your interest.


Posted by: gemmathehusky Jul 11 2019, 06:59 AM

I imagined you could read the data a char at a time, and extract the header that way. In that case is there a way of identifying the Header End, so you know when you have read the entire header. Is there a particular char value that would mark the header end? It obviously needs to be something that wouldn't accidentally occur elsewhere in the header.

Posted by: DanielPineault Jul 11 2019, 07:10 AM

I could be wrong, but I believe 'zExif' can be used to restrict to meta data extraction.