Results 1 to 12 of 12

Thread: 1 character = 1byte?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    1 character = 1byte?

    Does 1 character = 1 byte? I'm confusing myself here. I'm working with an ID3 v1 tag. The ID3 info is stored in the last 128 bytes. An example of what I'm doing is below. Basically what I'm asking is if 30 bytes are assigned to the songname does that mean the songname can only be 30 characters? I need to know this so I can set the Maxlength of my textboxes. Anyone know a more efficient way to divide this up? You pretty much have to have 3 bytes for the "TAG", 4bytes for the Year, and 2 bytes for the track. So maybe I just answer my own question! Anyway, would it be best to take bytes away from the comment and add them to the artist & title? Maybe reduce the comments to 10 bytes. Anyone know if there is a standard for this? Thanks

    VB Code:
    1. Dim id3Tag As String * 3
    2. Dim Songname As String * 30
    3. Dim Artist As String * 30
    4. Dim Album As String * 30
    5. Dim Year As String * 4
    6. Dim Comment As String * 28
    7. Dim Track As String * 2
    8. Dim Genre As String * 1

  2. #2
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    ID3 v1 tag is the standard but for your own purposes I suppose you could extend the song name in to the comments although it would not be recognised by other programs.
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    No way!!

    I mean, the ID3v1 is set up that way. You cannot create your own ID3v1. I mean, you can... but only your program would be able to read it. Winamp, for example with continue "dividing" that way and all the fields would be screwed up. If you want "unlimited" lenght (it has limit though, but I would congratulate you if you're able to write that long) you may find out about ID3v2.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Standard VS Winamp?

    The standard is:
    VB Code:
    1. Dim id3Tag As String * 3
    2. Dim Songname As String * 30
    3. Dim Artist As String * 30
    4. Dim Album As String * 30
    5. Dim Year As String * 4
    6. Dim Comment As String * 30
    7. Dim Genre As String * 1

    However, in Winamp the version1 tag includes Track #

    Did they take away 2 bites from comment to make track #?

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    To be honest... I don't know how they save the track. Because saving it's ASCII in the position where should be saved, doesn't seems to work. But if you want Winamp to understand your TAGS, you should stick to the standard. Winamp, gets the last 128 (speaking about the ID3v1)... if the first three characters are 'TAG', it reads the contents. If not... it shows as if the MP3 has no ID3v1 tag.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Standard VS Winamp?

    Originally posted by hipopony66
    The standard is:
    VB Code:
    1. Dim id3Tag As String * 3
    2. Dim Songname As String * 30
    3. Dim Artist As String * 30
    4. Dim Album As String * 30
    5. Dim Year As String * 4
    6. Dim Comment As String * 30
    7. Dim Genre As String * 1

    However, in Winamp the version1 tag includes Track #

    Did they take away 2 bites from comment to make track #?
    Actually, this is the way I have it:
    VB Code:
    1. Public Type ID3v1Tag
    2.   Id As String * 3
    3.   title As String * 30
    4.   Artist As String * 30
    5.   Album As String * 30
    6.   Year As String * 4
    7.   Comment As String * 29
    8.   Genre As Integer
    9.   Track As Byte
    10. End Type
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    it works?

    Does Winamp read the tag correctly even though comment is only 29?

  8. #8
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    BTW to set the max length of text boxes, set their MaxLength properties.
    You just proved that sig advertisements work.

  9. #9
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: it works?

    Originally posted by hipopony66
    Does Winamp read the tag correctly even though comment is only 29?
    Yes it does. That's the type variable I've got created, and both (Winamp and my program) can read and write ID3v1 and ID3v2 and they understand each other.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  10. #10
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Well.... quite almost. Actually, if I write (with my program) in the track field of the ID3v1, Winamp shows a strange character in the comment field and the track remains empty. ID3v2 works with no problems at all.... I can actually add the lyrics to them, and MusicMatch can read them.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  11. #11
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Ok... that bug is already in the past. I've fixed it, so this program can edit both ID3 tags with no problems, and Winamp can understand them.

    So, yes.... I can guarantee that the comments are 29 characters long.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  12. #12
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Actually, to be honest... The comment should be 28 character long (regarding to the information) and a Chr$(0) to separate the comment with the track (those would be the 29 characters)

    Or, in other words... you were pretty close hipopony66. They're saving the comments in 28 characters, and takes 2 for the track... but one of them is the chr(0) to separate both fields.

    Check this site, if anyone wants more information: http://www.id3.org/id3v1.html
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

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