-
Notifications
You must be signed in to change notification settings - Fork 213
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding accurate track length by iterating using input buffer #81
Comments
Hi) There is faster way if mp3 file contains vbr tag. You can use minimp3_ex to automatically use faster way: mp3dec_ex_t dec;
if (mp3dec_ex_open(&dec, input_file_name, MP3D_SEEK_TO_SAMPLE))
{
/* error */
}
/* dec.samples, dec.info.hz, dec.info.layer, dec.info.channels should be filled */ You also can use MP3D_DO_NOT_SCAN flag. In that case only fast way used, dec.samples is filled if vbr tag found and dec.samples == 0 otherwise. |
Thanks for the quick reply. Unfortunately I am working on embedded project where the mp3s are stored on a USB(FATFS), the file handling functions in minimp3_ex.h do not work. |
You can try minimp3_ex with MINIMP3_NO_STDIO and use mp3dec_ex_open_cb with custom io functions. |
Thank you, I will try that out , it seems like the best option. |
Sorry again, Is there another way to read the vbr tag, I only have 128 KB of RAM and 64 KB of CCRAM to work with and the memory allocation in mp3dec_ex_open is returning MP3D_E_MEMORY error. |
is it possible to make MINIMP3_IO_SIZE smaller? |
Yes, try following config:
|
Thank you for your help, It seems to be working now. |
the MINIMP3_NO_STDIO mp3dec_ex_close() function does not free dec->file.buffer. I just copied that bit from the other close function, it seems to be freeing that memory now. |
Thanks for catching this) Fixed in c02ef01 |
Hello,
I haven't been using this library for very long so I am wondering if there is faster way to find track length than what I have done below. Currently it is way to slow to even be useful.
The text was updated successfully, but these errors were encountered: