Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ID3 tag data in AIR project question

Guest
Sep 12, 2013 Sep 12, 2013

Hi

Couple of questions if you are able to help.

1. Is it possible to read ID3 data from a file object, or do you have to create a Sound, and send the file object's nativePath data to the Sound?

eg

public var snd:Sound = new Sound();

public function Sound_id3Example(file:Object) {

           

            snd.addEventListener(Event.ID3, id3Handler);

            snd.load(new URLRequest(file.nativePath));

}

2. If it HAS to be via a Sound, and I'm using a recursive function/loop to load files/file data from a directory (and am also trying to read id3 data during that loop), how do you make a recursive function wait until the ID3 event listener has fired before moving on to the next file?

Thanks for taking a look.

TOPICS
ActionScript
745
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 12, 2013 Sep 12, 2013

It's ideal to use the ID3 system because it will parse it for you. If you're using Adobe AIR you can use the FileStream class to read the file directly and extract the ID3. ID3V1 is at the end of the file, you can read up on the spec here:

http://en.wikipedia.org/wiki/ID3#ID3v1

Set the FileStream.position either 128 (standard) or 227 (extended) bytes from the end of the file and just read the tag. You'll have to parse what is returned via the spec. You can use FileStream synchronous or asynchronou

...
Translate
LEGEND ,
Sep 12, 2013 Sep 12, 2013

It's ideal to use the ID3 system because it will parse it for you. If you're using Adobe AIR you can use the FileStream class to read the file directly and extract the ID3. ID3V1 is at the end of the file, you can read up on the spec here:

http://en.wikipedia.org/wiki/ID3#ID3v1

Set the FileStream.position either 128 (standard) or 227 (extended) bytes from the end of the file and just read the tag. You'll have to parse what is returned via the spec. You can use FileStream synchronous or asynchronous. You'd probably want async so your app doesn't freeze on a big directory.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2013 Sep 14, 2013

Thanks Sinious!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 16, 2013 Sep 16, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines