Import multiple files into single track with separators

Hi

I’m trying to automate a tedious task that I have to do way too often. I need all files from some folder to be:

  • added to one audiosprite (one track in audacity);
  • a label assigned to the new part that equals to the sample file name;
  • added silence after each sample and .

First, I tried to use chains - but that didn’t work, since they are lacking some needed operations.

Then I’ve looked through some of the audacity plugins, but found nothing like I needed. I would be able to write my own plugins, if needed, but I didn’t know which type of plugin I should start looking at.

So, I need help :slight_smile:

Could anyone point me either:

  1. Existing plugin that does the task.
  2. Plugin type that can do all these operations automatically (import sound, move it to the first track, add label, add silence at the end).
  3. Maybe I’m missing a part of the chains functionality and it’s possible to actually do it?

Perhaps you could write an AutoHotkey macro to do this.


Gale

Thank you for advice. But I’d really like to know what’s the best way to do it via Audacity means? I mean, creating an audiosprite from samples is a very common task for an HTML game developer. So it would be great to have such functionality available. Even if by using plugins (or their combination).

North

That means that there isn’t. :wink:


Gale

Ok, thank you for your time and help. I guess, if I really want it to happen, I need to start downloading the Audacity sources :slight_smile:

North

Improvements to Chains would be very welcome. :slight_smile:


Gale

What’s the desired end result? Leaving Audacity out of the equation for a moment, what are you starting with and what do you want at the end of the entire process?

Hi

We start at:

  1. Folder with multiple short audio samples.

We need to get:

  1. Single audiosprite (mp3) with all the files from the folder, each sample separated with a 1 sec silence (sound engine requirement).
  2. Configuration (json) that describes the positions in a sprite.
    3 (optional). Project file in Audacity that will hold a single stereo audiosprite track and label track. It’s needed in case we need to make some minor changes during the integration.

So, when using Audacity, the whole task can be divided into two different ones:

  1. Create a sprite with labels.
  2. Export to mp3 and a configuration (for configuration I’ve created a separate thread).

North

So am I right in thinking that if you are starting with audio files a, b, c, d,… (all are mono WAV files with the same sample rate and bit format ?)
then what you want is an easy way to concatenate the files with one second of silence between each, and convert to MP3 format.
That gives you one MP3 file that contains (where “s” represents 1 second of silence):
a s b s c s …

If that’s right, then SoX may be your best option: http://sox.sourceforge.net/

Yes, exactly as you described. The only thing to add - there should also be a configuration text file with [name, start, duration] for a b c d within the audiosprite.

I will check the SoX, thank you!

North