0

I was wondering how possible it would be to, using code, store extra data inside of a file?

What I mean is, can a file, for example an image, or song, have data written to it and read from it without affecting the files usability? I would like to add information to an MP3 file for my program to read, but without stopping the file being usable. The moment I start converting bytes and changing them, the file becomes corrupt(naturally), so I was hoping that a file could be written to have a second part for separate information.

  • For `mp3` files, you could make use of `ID3` tags as discussed in the [related post](https://stackoverflow.com/questions/68283/view-edit-id3-data-for-mp3-files). – Axel Kemper Jul 02 '17 at 11:36
  • I have played around with that, but what i'm looking to do is have an mp3 file with many songs in it, and my program should be able to add data of where each song is in the file, and then my mp3 player will be able to jump to certain songs based on that hidden data, if that makes sense. – Joe Horrell Jul 02 '17 at 11:40
  • I would rather pack the `mp3` files and the meta data into a common `zip` archive. – Axel Kemper Jul 02 '17 at 11:43
  • 1
    While you could do that, it sounds incredibly tedious. Why not use an [M3U Playlist](http://n4k3d.com/the-m3u-file-format/)? – Mad Myche Jul 02 '17 at 12:45
  • What makes you think your or any mp3 player can do that? It is not in the specs! - But you can write newly invented tag of your own to the ID3V2 tags.. – TaW Jul 02 '17 at 12:50
  • Mp3 is the example in this instance. But what i'm asking for could be used for all sorts of things. For example an Executable file that interprets data from a separate compartment in itself. I was just wondering if it were possible, and if so, how? – Joe Horrell Jul 02 '17 at 14:28

0 Answers0