what kind of file? most file header's I've seen have an offset value that tells you where the raw data begins.. you could read in this value and then strip the rest of the file using many different techniques...
It's a wave file. Luckely, the length of the headers of the files I need to chop the header of is always 57 bytes.
I thought of using the CreateFile and WriteFile functions to make a copy of the file and using SetFilePointer to move the pointer 57 bytes.
Reading the file and moving the pointer works fine.
The only problem I have is to save the file again (under a different or the same filename). Because WriteFile requires a string to be written to the new file, and I don't want to read the complete file into a string and then write the string. I'm trying to find out if I can use the handle of the 'chopped' file to save it directly.
hmm... almost sounds like you're trying to strip the header without copying anything, for speed?... you said you don't want to read the complete string, but a buffer loop is pretty fast...
I do remember reading about an API that was called "StripFileHeader" (or something to that effect) -- but I don't know for what kind of files this was for or if it's what you're looking for... You might find something by researching File API's... I'm going to try find it again myself.
Thankx.
Actually, it's to convert a normal wave file into raw-pcm a-law file format. That's pretty much like a normal wave-file, but without the header-information (and some other small differences).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.