Results 1 to 3 of 3

Thread: Splitting files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ilirska Bistrica, Slovenia
    Posts
    242

    Question

    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

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    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.

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    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
  •  



Click Here to Expand Forum to Full Width