Old 03-02-2021, 02:13 PM   #1
BartR
Human being with feelings
 
BartR's Avatar
 
Join Date: Oct 2014
Location: Belgium
Posts: 1,612
Default How to read the ID3 Tag "CHAP=" from MP3s in C++?

i know, this is more a "stackoverflow" question, but it's related to a feature of Reaper. :-)

One of the great thing Reaper does is to be able to store markers/regions with the ID3 tag "CHAP=" since 2 versions ago, directly into MP3.
Excellent for Audio Books and for Podcasts (I have also made a couple of scripts for that purpose with the precious helps of some of you).

But now I would like to extract these "CHAP=" tags (markers/regions) in order to read (and to use) the content, with some C++ Code.

But I got lost.

Can you help me please?

So, having an MP3 file with inside some "CHAP=" tag(marker/region) how to extract it?
__________________
Reaper: always the most up-to-date.
O.S.: Windows 11 Pro
ReaPack (with bilingual Tutorials): https://bit.ly/ReaPack_Repository
BartR is offline   Reply With Quote
Old 03-02-2021, 02:24 PM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

The specification is here, but it's not very straightforward unfortunately:
https://id3.org/id3v2-chapters-1.0

For your purposes you can probably ignore the CTOC frame and just parse the individual CHAP frames, each of which contains the start offset and name of the chanpter.
schwa is offline   Reply With Quote
Old 03-02-2021, 04:12 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

If it helps, I've submitted a pull request for SWS getting the chapter markers via Reaper (C++) API:
https://github.com/reaper-oss/sws/pull/1489

edit:
Only useful if you'd be doing a Reaper extension though.

Last edited by nofish; 03-02-2021 at 04:17 PM.
nofish is offline   Reply With Quote
Old 03-02-2021, 05:00 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by nofish View Post
If it helps, I've submitted a pull request for SWS getting the chapter markers via Reaper (C++) API:
https://github.com/reaper-oss/sws/pull/1489

edit:
Only useful if you'd be doing a Reaper extension though.
Ultraschall itself has a specific extension, that supports export of chapter-markers, including chapter images. It does it via an action but it's probably possible to recode it as function. So maybe it's possible to add an export-function as well to SWS.

The sources for this are in here:
https://github.com/Ultraschall/ultra...ee/develop/src
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-03-2021, 01:55 AM   #5
BartR
Human being with feelings
 
BartR's Avatar
 
Join Date: Oct 2014
Location: Belgium
Posts: 1,612
Default

Thank you so much to all of you.

I will be busy experimenting and trying, following what you suggested.

Thanks a Zillion
__________________
Reaper: always the most up-to-date.
O.S.: Windows 11 Pro
ReaPack (with bilingual Tutorials): https://bit.ly/ReaPack_Repository
BartR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.