|
-
Apr 22nd, 2000, 10:11 PM
#1
Thread Starter
Addicted Member
Hello!
I combined 2 files, one text and one binary (MP3). I combined them ok, but I don't know how to split them back in original files. I separated text and MP3 binary data with #!#MP3INFO#!#, so that I could know where starts MP3. I already tried some things, but it didn't work; it cuts off a few bytes on the beginning of MP3 data.
Can anyone help me?
Regards
Zvonko
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Apr 22nd, 2000, 11:23 PM
#2
Hyperactive Member
Use InStr to find "#!#MP3INFO#!#", remove it using Left and Right to collect the seperate parts of the file, and save them to disk using the [b]Open[b] statement.
-
Apr 23rd, 2000, 06:59 AM
#3
Fanatic Member
I think you'll find that using string functions is not advisable on binary data.
instead of looking for the beginning of the mp3, look for the end of the text file, once you know how big it is start a loop from there to grab the rest to a binary array.
ie
ByteNo = 0
for x = textlength to FileLength
MP3Bytes(ByteNo) = YourFile(x)
ByteNo = ByteNo + 1
next
If you're looking for the mp3 header then write youself a little app to take a look at the bytes and have your app look for that pattern of bytes in the byte array (as byte numbers, not ascii).
You might want to check how you put them together in the first place in case you corrupted the mp3 file when you copied it.
You're just copying with byte arrays aren't you !!! Otherwise the text might have gone in in doublebyte unicode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|