Extract cue points from WAV

Started by mpriff, April 16, 2021, 09:21:26 AM

Previous topic - Next topic

mpriff

Hi,

I need to extract cue points from some audio WAV files.

-cuePoints -b

seems to extract all the cue points in binary:


D..~.data.~.....data....@..data@.....data.....data......data.......data..[snip]


Is there a way to have exiftools interpret this chunk and format the output so it returns a readable series of timestamps (in seconds)?

Thanks!


Phil Harvey

Currently, there is no way to do this.  If you send me a sample file I'll take a look and see if I can add this ability.  My email is philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mpriff

Thank you Phil! I've just sent you an email with a sample WAV containing a couple of cue points.

Phil Harvey

#3
This will require some testing, but here you go.

You should get what you want with this command and the attached config file:

exiftool -config cuepoints.config -mycuepoints -b FILE

Here is what I get for the test file you sent, but it still needs testing on a wider variety of input files.

> exiftool -config cuepoints.config -mycuepoints -b cuepoints.wav
1.000 1.000
3.000 3.000 markerNameAKAlabel
3.500 3.500


- Phil

Edit: I just noticed it doesn't report the end of your region properly (the last 3.5 should be 3.8).  I think I need a couple more samples with more than one different region to figure out how to decode this.

Edit2: This command and config file only work for ExifTool 12.24 and earlier.  See below for the command and config file for use with ExifTool 12.25 and later.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mpriff

Brilliant! Thank you so much, Phil. I emailed another couple sample files.

Phil Harvey

Done.  I've updated the cuepoints.config file in my previous post to fix the problem.

This version now decodes the cuepoints, labels and regions properly from all the files you sent.

With the next release (ExifTool 12.25) I will likely rename the "Unknown_LIST_adtl" tag, which will require a change to the config file, but in that case I'll post back here with an updated config file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mpriff

Perfect! Excellent, thank you so much! I just tried it on my original WAVs, and another sample where I used Adobe Audition (v.14.1.0.43) to add cue points (instead of Sound Forge v.15), equally successfully. (I'm still downloading another trial, will post back if there's any issues.)

Phil Harvey

#7
With ExifTool 12.25 and later, this use this command and the attached config file:

exiftool -config cuepointlist.config -cuepointlist -b FILE

the output is improved with this new config file:

> exiftool -config config_files/cuepointlist.config -cuepointlist -b cuepoints.wav
Cue Start End Label Purpose Text Notes
1 1.000 1.000
2 3.000 3.000 markerNameAKAlabel
3 3.500 3.830 rgn


The advantage is that it now extracts all region types (not just ranges), and will show region text and cue point notes if they exist.

(ExifTool 12.25 should be available within a couple of days.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


Phil Harvey

Actually, I realized I should be breaking the other fields out into separate columns, so I've edited the config file and updated my previous post with the new version.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mpriff

Even better! I'll give it a try when the version updates. Many thanks again.

Phil Harvey

ExifTool 12.25 is now available.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

horstdeworst

Excited thanks from someone who realized that Audacity can't extract the Cue Points set in their WAV file. Now onwards to level 2: I wonder whether I can script those Cue Points into labels in an Audacity project.

Thanks again!

olivier8064

#13
So great job Phil ! Thanks a lot.
As I would like to obtain a csv file of all my wav files (more than 10 000 !) with names of cue,
I wrote this line :
exiftool -config cuepointlist.config -cuepointlist -b -csv *.wav > out.csv
But as you can see in the attachment,Screenshot - 17_05_2023 , 10_35_42.png  there is something wrong for the second file (I only used 3 wav file for the example). What can i do to obtain clean out.csv file with complete tabulate list?
REgards



StarGeek

Can you share the actual output?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).