# MP3/ID3 Help

**URL:** <https://forum.kirupa.com/t/mp3-id3-help/10467>\
**Category:** Uncategorized\
**Created:** [January 1, 2003, 11:04pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467 "2003-01-01T23:04:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![titter](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@titter](https://forum.kirupa.com/u/titter)\
**Post date:** [January 1, 2003, 11:04pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/1 "2003-01-01T23:04:41Z")

</div>

Ok well I posted a topic about this b4 with no replies. I have gotten more info on this and was wondering what I should do. I am trying to learn actionscript and according to macromedia this is what they released:

\\\\\\\\\\\\\\\\\\\\\\\\\  
Accessing ID3 properties in MP3 files  
Macromedia Flash Player 6.0r40 and later supports MP3 files with ID3 v1.0 and v1.1 tags.

ID3 tag properties can be retrieved from a sound object when an MP3 sound containing an ID3v1 tag has been loaded using the attachSound() or loadSound() method. If a sound does not contain an ID3v1 tag, the ID3 properties will be undefined. Users must have the Macromedia Flash Player 6.0r40 or later in order for the ID3 properties to function.

Once the MP3 has completely loaded into the Sound object, you can access the following properties:

mySound.id3.songname  
mySound.id3.artist  
mySound.id3.album  
mySound.id3.year  
mySound.id3.comment  
mySound.id3.track (available only for ID3v1.1 tags)  
mySound.id3.genre

Note: The value of genre is an integer, not a name. For a table listing genre names and their corresponding integer values, see the ID3 website. To use a genre name instead of an integer for the genre property value, you must embed the genre table into the ActionScript in your movie.

For example, the following code loads an MP3 file and reads its ID3 tag properties:

```php
myTrack = new Sound();
                               
function RockAndRoll(){
  myTrack.start();                               
  if((myTrack.getBytesLoaded() == myTrack.getBytesTotal()) && myTrack.duration > 0){
      tf.text += "songName = " + myTrack.id3.songname +"." + newline;
      tf.text += "Artist = " + myTrack.id3.artist +"." + newline;
      tf.text += "album = " + myTrack.id3.album + newline;
      tf.text += "year = " + myTrack.id3.year + newline;
      tf.text += "comment = " + myTrack.id3.comment + newline;
      tf.text += "track = " + myTrack.id3.track + newline;
      tf.text += "genre = " + myTrack.id3.genre + newline;
      clearInterval (poll);
  }
}

myTrack.loadSound("myFile.mp3", false);
poll = setInterval(RockAndRoll, 1000);

```

If the attached MP3 file Some\_Linked\_Sound has an ID3 v1.0 or v1.1 tag for artist, the value is traced to the Output window.

Note: The entire song must be loaded for the ID3 properties to be available.

\\\\\\\\\\\\\\\\\\\\\\

I have a understanding of what it means, but I am lost on where and how to put the code. Any above help would be appreciated. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 1, 2003, 11:16pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/2 "2003-01-01T23:16:06Z")

</div>

you put it in a frame or button or where ever it is you want your your song to be loaded replacing myFile.mp3 with your mp3 file (loaded externally).

tf is the instance name of a multiline textField in that scope in which the id3 information is placed

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 12:02am UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/3 "2003-01-02T00:02:24Z")

</div>

Thanks, lemme go try…I was getting confused and couldnt figure out if it was a variable or instance.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 9:28am UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/4 "2003-01-02T09:28:11Z")

</div>

Senocular how would I got about streaming this…as events they take forever to load. When I stream them the sog lays but no id3 tag appears…Macromedia and there great innovations :sure: only if they would beter explain how to use it… :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 12:54pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/5 "2003-01-02T12:54:58Z")

</div>

that code waits for the song to be fully loaded before it tries to grab the tags (myTrack.getBytesLoaded() == myTrack.getBytesTotal()). Instead you just might want to check for the id3 object and see if that exists before trying to obtain the information (i.e. if (myTrack.id3)). To be honest, Ive never tried using flash to get id3 tags so I dont know if the song needs to be fully loaded before flash can read them, though since it is just extended header information, that shouldnt be the case and you should be able to get them not too long after the song has started to load.

Streaming btw, is simply a matter of saying  
myTrack.loadSound(“myFile.mp3”, **true** );

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 2:57pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/6 "2003-01-02T14:57:12Z")

</div>

The entire song must be loaded for the ID3 properties to be available. Whenever I go about streaming the song the song plays, but the id3 never loads. Ya most people have never tried id3 with flash, and macromedia kept kinda quiet…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 2:59pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/7 "2003-01-02T14:59:01Z")

</div>

Happy New Year.

Just to add to Senocular’s answer. I just read in a thread that the mp3 does have to be entirely streamed before you can access the ID tags.

[http://www.flashkit.com/board/showthread.php?threadid=360104&highlight=MP3+ID3](http://www.flashkit.com/board/showthread.php?threadid=360104&highlight=MP3+ID3)

Here is a great thread for music player related questions.

[http://www.flashkit.com/board/showthread.php?threadid=299918](http://www.flashkit.com/board/showthread.php?threadid=299918)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:02pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/8 "2003-01-02T15:02:53Z")

</div>

Thxs for the reply but the links provided in the post I have a.) already provided the information from the release, and b.) I know how to stream mp3’s with no problems…

[www.b7ven.com](http://www.b7ven.com)

Loads id3’s with a varation of the code I posted…hes the one that sent me the release well over a few weeks ago…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 2, 2003, 3:10pm UTC](https://forum.kirupa.com/t/mp3-id3-help/10467/9 "2003-01-02T15:10:25Z")

</div>

Just trying to help. Sounds like you are already there.
