'nur LFE' per Script

snibchi1 schrieb am 13.09.2018 um 15:19 Uhr

Hallo zusammen.

Per Script möchte ich den Surround Kanal bei einem Track auf 'nur LFE' setzen.

Ich bekomme das einfach nicht hin. Hat jemand eine Lösung?

Bisher funktioniert folgendes:

Vorher:

Script 'Stereo2Surround':

/**
 * Program: Stereo2Surround.cs
 * Description: This script will set up and change Stereo to Surround
 * Select one Audio track
 *
 * Revision Date: Sep 03, 2018
 * Author: Werner
 **/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ScriptPortal.Vegas;

public class EntryPoint
{
    Vegas myVegas = null;
    List<Track> SurrAudioTrk = new List<Track>();
    private static string[] trkNames = { "frontLeft", "frontRight", "center", "LFE", "rearLeft", "rearRight" };    
	public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;        
	// Collect list of selected audio tracks
        foreach (Track selTrk in myVegas.Project.Tracks)
        {
            if (selTrk.MediaType == MediaType.Audio && selTrk.Selected)
                SurrAudioTrk.Add(selTrk);
        }        
	// leave if no or more then one audio track selected
        if (SurrAudioTrk.Count != 1)
        {
            MessageBox.Show("Please select ONE AUDIO Track.");
            return;
        }
        
	// set up surround bus if not set
        if (AudioBusMode.Stereo == myVegas.Project.Audio.MasterBusMode)
            myVegas.Project.Audio.MasterBusMode = AudioBusMode.Surround;
        
	// rename first audio track to 'frontLeft'
        SurrAudioTrk[0].Name = trkNames[0];
        Track source = SurrAudioTrk[0];
        SurrAudioTrk.Clear();
        
	// https://forums.creativecow.net/docs/forums/post.php forumid=24&postid=942170&univpostid=942170&pview=t
        // Thank you Edward Troxel
        // Create 5 more audio tracks and copy events from source
        int trackIdx = source.Index;
        for (int i = trackIdx + 1, namesIdx = 1; i < trackIdx + 6; i++, namesIdx++)
        {
            Track dest = new AudioTrack(i, trkNames[namesIdx]);
            myVegas.Project.Tracks.Add(dest);            

		// Copy all events into dest tracks
            foreach (TrackEvent evnt in source.Events)
            {
                TrackEvent newEvent = evnt.Copy(dest, evnt.Start);
                AudioEvent audioEvent = (AudioEvent)newEvent;
                
			// Set disable left channel
                if (namesIdx == 1 || namesIdx == 5)
                    audioEvent.Channels = ChannelRemapping.DisableLeft;
                
			// Set disable right channel
                if (namesIdx == 4)
                    audioEvent.Channels = ChannelRemapping.DisableRight;
                
			// CENTER and LFE
                if (namesIdx == 2 || namesIdx == 3)
                    audioEvent.Channels = ChannelRemapping.Mono;
            }
        }
        
	//  Set disable right channel at source track events
        foreach (TrackEvent evnt in source.Events)
        {
            AudioEvent audioEvent = (AudioEvent)evnt;
            audioEvent.Channels = ChannelRemapping.DisableRight;
        }
        
	// find LFE audio track and set surround to 'only LFE'
        foreach (Track lfe in myVegas.Project.Tracks)
        {
            if (lfe.Name == trkNames[3])
            {
                lfe.Selected = true;
                AudioTrack tmpLFE = new AudioTrack(lfe.Index);
                // what can i do??????
                break;
            }
        }
    }
}

Nachher:

Zuletzt geändert von snibchi1

Audiovisuelle Geräte

  • Canon EOS 6D
  • Canon EOS 450D
  • Nicon Coolpix S7000
  • AC800 Actioncam
  • Sony HDR-SR5

Hardware-Ausstattung

  • Monitor: LG Ultrawide 34UC79G
  • Tastatur: MSI GK 50 Elite
  • Maus: Corsair M65 PRO RGB
  • Gehäuse: CooMas HAF X 942-KKN1 ATX
  • PSU: be quiet! Staight P11 850W
  • Board: MSI MEG X570 ACE (Bios 7C35 v 1.K0, 01.03.2023)
  • CPU: AMD Ryzen 9 3900x
  • Cooler: Noctua NH-D14 SE2011 (AMD Adapter)
  • RAM: 2x 16GB D432GB 3600-17 Predator K2 KHX
  • SSD: 1x 2TB Gigabyte GP-ASM2NE6200TTTD
  • SSD: 1x 4TB SanDisk Ultra 3D
  • SSD: 1x 512GB Samsung 850 Pro
  • GPU: 1x 12GB MSI Radeon RX 6750 XT
  • NAS: Synology DS 218+ 2x 6TB

Software

  • Windows 11 Pro 23H2 (Build 22631.3447)
  • MAGIX Vegas Pro 14 - 21 (Build 300)
  • MAGIX Photostory Deluxe 2024 23.0.1.159 (UDP3)
  • Sound Forge Audio Studio 17
  • ADOBE Master Suite CS6, Photoshop CC

Kommentare

Noch 0 Kommentare - Schreibe den ersten Kommentar ...