rochars / wavefile

Create, read and write wav files according to the specs. :star: :notes: :heart:
MIT License
226 stars 48 forks source link

Recognize End Points for Cue Markers #17

Closed craigeley closed 4 years ago

craigeley commented 4 years ago

This is a feature request or enhancement, but I'm wondering if it is possible for wavefile to recognize cue markers that have both a start AND end point—markers like this can be created in Adobe Audition, for example. Note the "start" and "end" times in this screenshot:

Screen Shot 2020-01-02 at 3 14 14 PM

And here is a link to the file that the screenshot was taken with:

https://www.dropbox.com/transfer/AAAAACWjc7db0I3xtIeZ8l9CdhEH-kgKOCyCfrkJFS1nwrv-vYQ3Nu8

Would love to know your thoughts on if this is possible.

rochars commented 4 years ago

Thanks for the file!

The bug that corrupted files like this is solved in version 9.0.2 - the files can be saved and the regions are kept (they are showing up in Reaper). Some of the values are not displaying correctly, still.

This file uses some features that the current version of wavefile do not support, but im working to add support for them in future releases. I included the file in the test suite. Thanks!

Cheers! Rafael

rochars commented 4 years ago

Version 9.1.1 should handle the regions correctly.

Cheers! Rafael

craigeley commented 4 years ago

Amazing! Read and write? Is that documented yet?

rochars commented 4 years ago

In version 9.x you can only read and write regions that already existed in the file. In v10.x will be possible to use the setCuePoint method to create both cue points and regions.

Cheers!

rochars commented 4 years ago

Version 10.0 is out; now you can add regions like this:

// create a cue region with a label:
wav.setCuePoint({position: 1500, end: 2500, label: 'some label'});

To create a standard cue point, ommit the 'end' attribute:

// create a cue point with a label:
wav.setCuePoint({position: 1500, label: 'some label'});
// create a cue point with no label:
wav.setCuePoint({position: 1500});

Cheers! Rafael

craigeley commented 4 years ago

This is awesome. I have no idea the magic that makes this script work, but I would be interested to know if it can parse files from Pro Tools, which writes "clips" into its files in a way that I have never been able to get another app to read. But that's a different issue for a different day. Thanks again!

rochars commented 4 years ago

Could you provide a file with some clips like that?

Cheers! Rafael