JSON Audio Sprite Data Exporter

Hi there, I’m working on audio sprites and would like to use Software to automate the data exportation process.

I’m not very familiar with Audacity nor Nyquist so please correct me if I am wrong or when there is a better way :}

The data structure it would look like this

      [{"startTime": 0, "endTime": 3}]

Hopefully that’s valid JSON

Sheet name

  • Sprite name
  • Splice data

(There might be a lot of Splice data in one Sprite that is why it’s an array)

I forgot to include other details

A Sprite Sheet is the entire Audio file
A Sprite is a group of related Sounds
A Splice contains data (startTime and endTime)

I am thinking that it could be a good option to use region label for Sprites and point label for Splices

If there is always a 1 second gap between each Splice and a 2 second gab between each Sprite it would be easy to tell them apart

I am familiar with lua so if you could point me to the right direction I can probably write my own software for this

It isn’t :wink:

Perhaps you mean:

   "sheetName": [
         "spriteName": [
               "startTime": 0,
               "endTime": 3

I don’t understand where Audacity fits in. What do you want Audacity to do?

I want to use Audacity to visually label each Sprite and Splice and then use a plugin to read that data then export it as a JSON file

If you had a list of “Splice times” like this:

0.000000	2.890884	
7.151746	11.261678	
19.504762	31.021859	
42.353197	53.963175	
63.529796	69.845624

would that be sufficient to allow you to write a lua script to generate your JSON?

The above example was created by exporting a label track that contained 5 “region labels”.
See: Label Tracks - Audacity Manual and Importing and Exporting Labels - Audacity Manual

I’d still need the Sprite name and Sheet name to construct the data

The JSON data would be converted into a Lua table
Something like that

What determines those names?

Would probably use region label for Sprites and point label for Splices?

I’m not sure if you can assign text to labels but I’d assume so

Yes you can. See the links to the manual that I posted previously.

I see that is a very useful feature, thank you for pointing it out!!

It is nice that I can export the start time and end time of each region label, however is there a way their names could also be exported as well?
Or maybe read by another program as a project file and then export the data as a Lua file?

The track name or file name would be the Sheet name, → file name
Each Point Label would be the Sprite name, → Contains Splices
Each Region Label would contain Splice data, → start and end time

While the default export format is helpful it still requires human input which I would like to avoid, however if this isn’t possible then it’s fine.

See: Importing and Exporting Labels - Audacity Manual