Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / MP3 ID3 Tag Reading (source code included)

Author
Message
JohnStabler
AGK Bronze Backer
10
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 16th Sep 2017 15:16 Edited at: 16th Sep 2017 15:19
Hi folks! I haven't posted for a while, so I thought I'd share some useful source code. However, it could probably be improved and I'm happy for people to test and provide feedback. The code allows you to read basic tag information from ID3v2 MP3 files.

There are some helper functions that could probably be improved but the performance is already pretty good. It only takes a minute or so to process ~3000 files and seems robust with ID3v2.3 and ID3v2.4 files.

A couple of notes:

1. It does not process footers
2. For performance reasons it does not use the content of frames longer than 512 bytes. This means all the useful frames are extracted (e.g. title, artist, album) but embedded images are ignored.
3. The GetMemblockString function doesn't handle unicode so I have hacked it so only useful ASCII characters are recognised. This is the thing I want to improve most.

If anybody has any exotic MP3 files (e.g. ID3v2.2 or extended headers) to test with then that would be helpful.



TIP: If you're trying to read a path outside of the AppGameKit read/write folders then be sure to use the "raw:" prefix in the path.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Sep 2017 23:15
Done any speed tests yet? Myself and a few others have written DBP readers. I don't recall if mine handled footers either or not.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
JohnStabler
AGK Bronze Backer
10
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 17th Sep 2017 00:06
At the moment I have implemented a queue system so that one file gets processed per frame. It runs at 60fps no problem, so that's at least 60 files per second. I'll try and push it some more over the next couple of days.

Login to post a reply

Server time is: 2024-03-28 17:22:24
Your offset time is: 2024-03-28 17:22:24