Beispiel #1
0
    void processBlips()
    {
        selectedVideoEvent = util.GetFirstSelectedVideoEvent();

        if (selectedVideoEvent == null)
        {
            util.ShowError("No video event selected");
            return;
        }

        //Create a temporary WAV file, and export the audio span of selected video event
        string wavePath = wavUtil.CreateVideoEventWAV(selectedVideoEvent);

        if (wavePath == null)
        {
            util.ShowError("Unable to export temporary WAV");
            return;
        }

        short[] leftChannel, rightChannel;
        bool    wavReadStatus = wavUtil.ReadWav(wavePath, out leftChannel, out rightChannel);

        if (wavReadStatus == false)
        {
            util.ShowError("Unable to read WAV export file.");
            return;
        }

        //Delete the temporary file
        File.Delete(wavePath);

        //Find all blips in the right channel and split tracks at blips
        blips = wavUtil.FindBlips(rightChannel);
    }
    void ProcessBlips()
    {
        selectedVideoEvent = util.GetFirstSelectedVideoEvent();

        if (selectedVideoEvent == null)
        {
            util.ShowError("No video event selected");
            return;
        }

        TrackEventGroup selectedVideoEventGroup = selectedVideoEvent.Group;

        //take the first audio track in the selected video's group
        foreach (TrackEvent trackEventInGroup in selectedVideoEventGroup)
        {
            if (trackEventInGroup is AudioEvent)
            {
                selectedAudioEvent = trackEventInGroup as AudioEvent;
                break;
            }
        }

        if (selectedAudioEvent == null)
        {
            util.ShowError("Selected video event has no audio event in its group");
            return;
        }

        //Create a temporary WAV file, and export the audio span of selected video event
        string wavePath = wavUtil.CreateVideoEventWAV(selectedVideoEvent);

        if (wavePath == null)
        {
            util.ShowError("Unable to export temporary WAV");
            return;
        }

        short[] leftChannel, rightChannel;
        bool    wavReadStatus = wavUtil.ReadWav(wavePath, out leftChannel, out rightChannel);

        if (wavReadStatus == false)
        {
            util.ShowError("Unable to read WAV export file.");
            return;
        }

        //Delete the temporary file
        File.Delete(wavePath);

        //Find all blips in the left channel and split tracks at blips
        blips = wavUtil.FindBlips(rightChannel);
    }
Beispiel #3
0
    public void FromVegas(Vegas vegas)
    {
        this.vegas   = vegas;
        this.util    = new Util(vegas);
        this.wavUtil = new WavUtil(vegas, util);

        VideoEvent videoEvent = util.GetFirstSelectedVideoEvent();

        if (videoEvent == null)
        {
            util.ShowError("No video event selected");
            return;
        }

        //Create a temporary WAV file, and export the audio span of selected video event
        string wavePath = wavUtil.CreateVideoEventWAV(videoEvent);

        if (wavePath == null)
        {
            util.ShowError("Unable to export temporary WAV");
            return;
        }

        short[] leftChannel, rightChannel;
        bool    wavReadStatus = wavUtil.ReadWav(wavePath, out leftChannel, out rightChannel);

        if (wavReadStatus == false)
        {
            util.ShowError("Unable to read WAV export file.");
            return;
        }

        //Delete the temporary file
        File.Delete(wavePath);

        //Find all blips in the left channel and split tracks at blips
        List <WavUtil.Blip> blips = wavUtil.FindBlips(rightChannel);

        wavUtil.SplitAtBlips(videoEvent, blips);
    }