No internet connection
  1. Home
  2. How to

Need the 'voiceover with some light background noise' script

By Jason Lawrence @Jason_Lawrence5
    2022-03-06 02:48:33.762Z2022-03-06 02:50:26.547Z

    Hi there. New to SF, and asked the question on Facebook. @Kitch was kind enough to show me a script that did exactly what I need!

    Thanks

    • 5 replies
    1. Kitch Membery @Kitch2022-03-06 02:55:45.131Z

      Hi @Jason_Lawrence,

      Welcome to the forum. Here is the script;

      const fadePresetNumber = 1;
      
      /**
       * @param {'Up'|'Down'} direction
       */
      function navigateTrack(direction) {
          if (direction === 'Up') {
              sf.ui.proTools.getMenuItem("Edit", "Selection", "Extend Edit Up").elementClick();
              sf.ui.proTools.getMenuItem("Edit", "Selection", "Remove Edit from Bottom").elementClick();
          }
          if (direction === 'Down') {
              sf.ui.proTools.getMenuItem("Edit", "Selection", "Extend Edit Down").elementClick();
              sf.ui.proTools.getMenuItem("Edit", "Selection", "Remove Edit from Top").elementClick();
          }
      }
      
      function createFades(presetNum) {
          sf.ui.proTools.getMenuItem('Edit', 'Fades', 'Create...').elementClick();
      
          var batchFadesWin = sf.ui.proTools.windows.whoseTitle.is('Batch Fades').first.elementWaitFor({ timeout: 500 }, 'Could not find Batch Fades window').element;
      
          batchFadesWin.buttons.whoseTitle.is('Fade Preset Toggle').allItems[presetNum - 1].elementClick({}, 'Could not click preset button');
      
          batchFadesWin.buttons.whoseTitle.is('OK').first.elementClick();
      
          batchFadesWin.elementWaitFor({ waitType: "Disappear" });
      }
      
      function main() {
          sf.ui.proTools.appActivateMainWindow();
      
          var originalSelection = sf.ui.proTools.selectionGet();
      
          const oldEditMode = sf.ui.proTools.editModeSet({ mode: "Slip", }).oldMode;
      
          sf.ui.proTools.getMenuItem('Edit', 'Fades', 'Delete').elementClick();
      
          const cursorToolCluster = sf.ui.proTools.mainWindow.cursorToolCluster;
          cursorToolCluster.buttons.whoseTitle.startsWith('Grabber tool').first.popupMenuSelect({
              isRightClick: true,
              menuPath: ['Object']
          });
      
          navigateTrack("Down");
          navigateTrack("Up");
      
          sf.ui.proTools.getMenuItem('Edit', 'Copy').elementClick();
      
          navigateTrack("Down");
      
          sf.ui.proTools.getMenuItem('Edit', 'Paste').elementClick();
      
          sf.ui.proTools.toolsSelect({ tool: "Selector", });
      
          navigateTrack("Up");
          navigateTrack("Down");
      
          sf.ui.proTools.getMenuItem('Edit', 'Copy').elementClick();
      
          navigateTrack("Up");
      
          sf.ui.proTools.getMenuItem('Edit', 'Paste').elementClick();
      
          navigateTrack("Down");
      
          sf.ui.proTools.getMenuItem('Edit', 'Clear').elementClick();
      
          sf.ui.proTools.selectionSet({
              selectionStart: originalSelection.selectionStart,
              selectionLength: originalSelection.selectionLength,
          });
      
          sf.ui.proTools.getMenuItem('Edit', 'Heal Separation').elementClick();
      
          navigateTrack("Up");
      
          sf.ui.proTools.editModeSet({ mode: oldEditMode, });
      }
      
      //Change the Main Counter to Samples for the duration of the main function
      sf.ui.proTools.mainCounterDoWithValue({
          targetValue: 'Samples',
          action: () => {
              main();
              createFades(fadePresetNumber);
          }
      });
      

      Here is a link on how to use a script from the forum :-)

      Let me know if you get stuck.

      Rock on!

      1. JJason Lawrence @Jason_Lawrence5
          2022-03-06 02:57:57.579Z

          Thank you, sir. I'll see what I can make of it. Really appreciate it, and am dying to hear of other innovations you've created in the audiobook world.

          You just bought me at least of day of busy work.

          1. Kitch Membery @Kitch2022-03-06 03:18:56.539Z

            Hi @Jason_Lawrence5

            Yeah, there are lot's more I used... We all have a different way of working so it you are after a specific workflow, I'll check my scripts and see what I've got. :-)

            1. In reply toJason_Lawrence5:
              Kitch Membery @Kitch2022-03-06 03:36:24.820Z

              BTW... Here are the steps to take;

              • Have the room tone track directly under the dialog track.
              • Ensure that "Link Track and Edit Selection" is turned on.
              • Make a selection that starts at the beginning of the first clip and extends to the end of the last clip.
              • Run the script :-)
          2. J
            In reply toJason_Lawrence5:
            Jonathan Johnson @Jonathan_Johnson
              2025-02-05 19:25:53.450Z

              This was working for me but now I get this error message....

              VOICEOVER WITHsome light background noise FAILED

              Error: Line 22

              is see that line 22 is referencing a 'Fade Preset Toggle'

              IS there a pre set that need to be made/ labels for this to work right?

              I'm on a Mac OS 10.15.7 SoundFlow v5.10.1