header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
khze86
Points:180
Posts:8

11/24/2009 3:46:50 AM

Title: Get metadata from streaming mp3


Hi..

I have a problem getting the metadata of a mp3 file streamed using flash media server.

I've no problem getting the metadata of a flv file.

I know that mp3 uses ID3 metadata instead of the normal metadata that flv uses.

So is there any way i can get the metadata of a mp3 file so that i can get the duration of the mp3?

thanks~~~



1
bull
Points: 0
Posts:0
11/24/2009 4:00:46 AM



no currently there is no other way to get total duration of mp3 file , unless its loaded completely at client system.I have used ID3 only to get meta info.

2
khze86
Points: 180
Posts:8
11/24/2009 4:15:22 AM



so how did u use id3 to get the metadata?
can u show me some code samples?

3
bull
Points: 0
Posts:0
11/24/2009 4:45:28 AM



I use the following code to read ID3 informatio from a mp3 file running in flex application, Check this example :

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="readID3Info()">
<mx:Script>
	<![CDATA[
		private var sound:Sound;
		private function readID3Info():void{
		 sound = new Sound(new URLRequest("test.mp3"));
 			sound.addEventListener(Event.ID3, onID3);
		}

 private function onID3(event:Event):void {
    trace(  sound.id3.album );
    trace(sound.id3.artist)
    trace(sound.id3.comment)
    trace(sound.id3.genre)
    trace(sound.id3.songName)
    trace(sound.id3.track)
    trace(sound.id3.year)
 }
	]]>
</mx:Script>
</mx:Application>


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+3 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions