Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8177555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:32:17+00:00 2026-06-06T23:32:17+00:00

I’m using the taglib library (1.7.2) in my Qt application, to read some metadatas

  • 0

I’m using the taglib library (1.7.2) in my Qt application, to read some metadatas of mp3 files from a music folder.
The problem is that I find it very slow.

For example, this is the code:

QString path = "C:/Music/";
QDir d(path);
QStringList fileTypes;
fileTypes << "*.mp3" ;
d.setNameFilters(fileTypes);
QStringList pathList = d.entryList( QDir::NoDotAndDotDot | QDir::Files);

QTime t;
t.start();
foreach (QString fileName, pathList) {
    fileName = path + fileName;
    TagLib::FileRef *f = new TagLib::FileRef(fileName.toStdWString().c_str());
}
qDebug()<<t.elapsed();

This code takes about 11s to load a folder containing 400 songs, ie about 28ms for each file.
This is the line very slow:

TagLib::FileRef *f = new TagLib::FileRef(pathFile.toStdWString().c_str());

Is it normal it’s so long ?
I’ve tried using multi threading, but it doesn’t change anything, and it doesn’t come from my PC, as it’s enough powerful.
The weird thing is that once all the files have been loaded, the next time it load the folder again, it’s done instantaneous (until i reboot the os).


I have also another problem.

Sometimes, when a tag is not set, the app crashes, and output:

HEAP[myapp.exe]: 
Invalid address specified to RtlFreeHeap( 0ED90000, 0ED92CC0 )

On the following line for example:

if (!f->tag()->genre().isNull())

I’m using Windows 7.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:32:18+00:00Added an answer on June 6, 2026 at 11:32 pm

    Sometimes, when a tag is not set, the app crashes, and output…

    It is one of the many strange design decisions in the TagLib. The AudioProperties object is NULL when there are no tags. You have to live with it and add some extra code to check for NULLs.

    The weird thing is that once all the files have been loaded, the next time it load the folder again, it’s done instantaneous (until i reboot the os)

    It’s not weird, since Windows 7 has a very advanced and very aggressive disk I/O caching mechanism. Once you “touch” the file, it gets to the RAM and the next time you access it – it’s almost instantaneous. 400 mp3 files is not much and it all fits into the RAM.

    11s to load a folder containing 400 songs

    400 times you have to perform a disk seek which usually takes 9-11ms on a typical hard disk drive (yes, it’s only 0.1ms for the SSD). So you have at least 10*400 = 4 seconds just to “rewind” the drive’s head, if the folder is fragmented. Since id3 tags may occur at the beginning and at the end of the file this virtually increases the number of reads twice (you have to rewind to the end of the file), thus giving the 2x time (about 8 seconds).

    Resume: The time to read the folder is close to something realistic. There is a number of quircks in TagLib (like NULLs or the inability to overload the file operations to allow, e.g. reading from archives), but they are avoidable. The functionality of TagLib is really good and in many aspects it is unique (broad format support).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.