Add silence from length

I’m trying to make a voice mod on l4d2 and ingame the sounds are all static, it turns out the files need to be the same time length as the original, and there’s over 3,000 audio files I’d need to manually edit individually.
Is there any way I could point audacity to the original files, and export the new ones as the same length without doing it all manually?

I’m trying to understand what exactly you are doing, and i don’t have a clear picture of what that is or how we can help.
You’ve created 3000 new audio files? How did you do that? Isn’t the usual way of doing this to modify copies of the original files and check that they work as you go?

I’m making a voice mod for a game, and the “new” audio files need to be the same length of time as the original game files or else they don’t work. (loud screeching occurs when certain requirements are not met) I have the sample rate and what not down, but I was wondering if audacity could automate the whole process of opening the original file, and the modded file, cutting the original file down to size so that when the modded file is pasted into it, it stays the same length as the original file. Because I’d have to do this manually and MAN. If there isn’t a way. I’ll still do it but. Damn.

Man I am terrible at explaining. The URLS are screenshots explaining the process in detail.

https://gyazo.com/bec09a801eb97ea5235e5ab6e8b4ab59 1
https://gyazo.com/3e5666de2880bdd68a8be84511294ca9 2
https://gyazo.com/7ac465b32ee5c569173e1b58752ea025 3
https://gyazo.com/75d9aa0bec70426af97c3099c0be2b93 4
https://gyazo.com/e95f7ee96a5887e33e9416bbdfd2a6ea 5

I don’t follow. Why do you need to cut down the “original” files? Surely those are the correct length :confused:

Where did your modded files come from? I’m wondering why you have 3000 files that are all the wrong length.
What format are the files? if they are MP3 it may be impossible to make them an “exact” length because length is never exact for MP3 files.

Nah, the original files are the correct length, the modified ones are just sounds of Link from Zelda games, I need to make the modified ones the same length as the original files by generating silence at the end of each of them to match the length of the originals. If this could be automated using audacity. It would help out immensely saving days of doing it manually.

OK, I’m getting the idea now.
You have downloaded a load of modded files from somewhere, tried to put them into your game and found that they don’t work.
You’ve since found out that they need to be 22050 Hz sample rate WAV and that they need to be the exact right length.

Am I right so far?

I very much doubt that they need to be 32-bit float WAV - that would be extremely unusual.

I’d suggest that you download “MediaInfo” from MediaInfo - Download MediaInfo for Microsoft Windows. Get the MediaInfo version without installer, because the installer may have adware. Open one of the original files in MediaInfo and select “Text” (or HTML) from the “View” menu. That will show you detailed information about the file.

Then try making ONE of your modded files match the specification. Pick one that is easy to test in the game. Replace the original version with your edited modded version. Does it work? Keep a note of the exact steps required to make it work - hopefully the steps will be the same for all the other files, then we can look to see how much of the job we can automate.

Aye, those screenshots were from a friend who also made a voicepack, I asked them what their process for doing it was because mine was taking much longer.
Also, I have audacity set to 16 bit pcm (default) so don’t worry. I also tried converting the entire thing into 32bit float because their soundpack worked with it, I was unsuccessful and it just made the sounds sound worse, pretty sure the files just need to be 16bit pcm, 22050hz and the same length as the originals to not retain audio bugs. (at least for voices)

My current process is:

  1. drag and drop original file
  2. drag and drop modded file
  3. generate silence on original file
  4. cut original file from the end of the modded file
  5. copy + paste the modded file into the original file
  6. click the x on the blank file
  7. export

I have a few files I can test out real quick
will report back

Can confirm the right length fixed the audio bugging out. Although I found out that some of my files are actually longer than the originals in which case I faded out about half way through, all the way to the end, to fix the clipping, some of the audio levels are different as well, but I haven’t really used Audacity enough to know how to make them louder.

Didn’t you say that your modded files are stereo and the original files mono? Do stereo files work or do you need to convert them to mono?

They need to be mono

Unless the required length is the same for each file, I don’t think there is any way that you can automate the process.
Converting stereo to mono can be done as a batch process and exporting as WAV can, but changing the sample rate can’t and adjusting the length to match another file can’t.

You can use the Normalize effect to make all of the files have the same peak level, but I’m not sure how much that will help as the same peak level (maximum amplitude) does not mean that they will sound the same “loudness”. I think the best you can do is to “get in the flow”, and streamline your way of working as you go. Yes it will take time, but I don’t see any way round that.

Well it’ll keep me out of trouble at least.

EDIT: But automating that process is possible?? There’s not many of the modded files that are longer, most of them are shorter, and the ones that aren’t I can find and edit manually later. Normalizing is also making the files louder. I’ve already converted the files to the same frequency, rate, and format. It’s just this part that takes forever.

If Normalizing the entire file gives you an acceptable result, create a Chain containing Normalize and an ExportWAV command then apply the Chain to files that are in the same folder.

If Normalize does not make the files equally loud, add the ReplayGain Nyquist plugin to Audacity’s Plug-Ins folder. Then assuming you are using the latest Audacity 2.1.2, open Effect > Add / Remove Plug-ins, select ReplayGain, enable it, then OK. Then add ReplayGain instead of Normalize to the Chain.

See here for how to use that ReplayGain plugin ReplayGain plug-in



Gale

Thanks for the tips, but you misunderstand. I need audacity to make files the same length as other files by adding silence to the end of them. So far I mapped keys to help me do it quicker but if it could be automated that would help me out a lot.

Batch processing files can only be performed on one file at a time. There’s no way to import a second file into the project as part of a batch process.

The quickest way that I can think of to extend a file to the same length as a longer file is:

  1. Import the (longer) original file and the (shorter) modded file.
    The files will create two tracks, one above the other.

  2. Double click on the original file to select it.
    The original file is selected, the modded file isn’t selected.

  3. Press Ctrl+L
    The original file is silenced.

  4. Export to create a new modded file.


    Tip: If you’ve not already done so, you can prevent the Metadata Editor from popping up in Preferences: http://manual.audacityteam.org/o/man/import_export_preferences.html This does NOT prevent metadata being written to the exported file, it just stops the editor from popping up.

That’s actually brilliant.
I was opening the original files, dragging + dropping the new file in, adding silence to it, copying pasting it into the original file, deleting the duplicate and exporting. Your way is much more convenient.

Edit: in fact, if I silenced ALL the original files through a batch process, all I’d need to do is import the new files and export.

Almost as quick to just press Ctrl+L :wink:
Anyway, if you do that, avoid overwriting your originals - good practice for all audio editing is to keep backups of everything.

I’m having trouble with metadata automatically being added, the weird thing is it’s all the same metadata from one track, unlike how it usually adds metadata by the original track name. The original files contain no metadata either so this shouldn’t be happening.

EDIT: it was from adding silence to the original files, added metadata to them, I used some software to remove them all though.

This “feature” has bugged me for years :imp:
There really should be a way to NOT write metadata in exported files, but there isn’t.

Metadata tags are complicated. It’s something that has evolved gradually over time, leading to many different “standards”. Quite often you will find that a file has metadata that shows up in one program, but not in another. A classic example is WAV files, which “appear” to have no metadata in most programs, but show metadata in others (Audacity is one of the few applications that supports metadata tags in WAV files).

An Audacity Project can only have ONE set of metadata at a time. I believe that importing a file always updates the project metadata.