Community Forums Archive

Go Back

Subject:Altering "New Silence" script
Posted by: roblesinge
Date:3/8/2009 2:11:03 PM

I'm trying to alter the "NewSilence" script that currently creates a new file with 10 seconds of silence. Unfortunately, what I need to do is proving to be beyond my very minimal scripting skills. I'm hoping someone can point me to some code that will help me alter this script.

Let me explain what I'm trying to accomplish. I'm making Message on Hold productions which are comprised of several voiceover segments evenly spaced out over a bed of music for a specified length of time. I currently use a silence file to maintain that spacing. I want to use a script to calculate and create that silence file using the following calculation. I need the script to look at all of the audio files in a user-selected folder, add up the lengths of the audio files, subtract that length from a user-input "total production length" and then divide that figure by the number of segments in the folder. This silence file would then be saved in that same user-defined audio segments folder, titled as "silence" or something like that.

For example, Let's say I'm making a 4-minute long production, with 5 segments that are a total of 2(m):25(s).345(ms) in length. To evenly space out these segments, I would need a silence file 0:18.931 seconds in length. So, I would need the script to ask for a "Total Production Length" and the location folder of the audio segments. Then run the calculation:

(Total_Production_Length - Total_Segment_Length) / Number_of_Segments

This would calculate the length of the silence file which passes into the creation part of the script.

Hopefully this makes sense.

Basically, I need to create the variable to pass into the NewSilence script. I wrote a C program a long time ago that did calculated the silence amount for me (simple, but saves calculator time). Then I would just create a new file and insert this silence manually. This is the next step of that vision--to be able to automatically create the silence file. Unfortunately, I'm not as adept at pulling summary info and passing that into a script.

Any help would be appreciated. I've found a lot of useful info on this forum.

Rob.

Go Back