MP3/ID3 Help

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:

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!

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

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

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… :-\

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);

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…

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

Here is a great thread for music player related questions.

http://www.flashkit.com/board/showthread.php?threadid=299918

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

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…

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