I usually manage to find solutions to stuff like this on my own, but i'm afraid this time i've come away empty handed. Hopefully someone can help clear this up for me.
I am trying to read a binary file in visual basic 6, but the file has a custom type.
The values are not stored as regular bytes, but as bit values of varying lengths.
For example one value i am trying to get is stored in 20bits, another in just 5.
I'm pretty good at VB, and when it comes to reading a normal file with 8, 16 or 32 bit values i can handle that fine.
The file type in question is actually a FLAC file (a compressed WAVE audio file). The full specification is here: http://flac.sourceforge.net/format.html#stream
I'm not in need of parsing the whole file. But i need to get the "Sample rate in Hz" value stored in 20 bits and the "(bits per sample)-1" stored in 5 bits.
I have attached a sample FLAC file, where the bits per sample is 16 and sample rate is 44100.
(edit: the file in the zip is called sample_flac.mdb, rename from .mdb to .flac)
Anyone think they can help?