知识库

脚本示例:将*后一次录制添加到 vMix 作为输入

以下示例代码使用 vMix 4K 和 Pro 版本中的 vMix 脚本功能。
 
代码默认在默认录音文件夹 (Documents\vMixStorage) 中查找新的 MP4 录音
 

 

        Dim szExt As String = ".mp4"
        Dim szFolder As String = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) & "\vmixstorage"
        Dim szLatestFile As String = ""
        Dim dLatestFile As Date = Nothing
        For Each szFile As String In System.IO.Directory.GetFiles(szFolder)
            Dim fi As New System.IO.FileInfo(szFile)
            If fi.Extension = szExt Then
                If fi.LastWriteTime > dLatestFile Then
                    szLatestFile = szFile
                    dLatestFile = fi.LastWriteTime
                End If
            End If
        Next
        If System.IO.File.Exists(szLatestFile) Then
            API.Function("AddInput", Value:="Video|" & szLatestFile)
        End If

 

 
 
 
 
更新时间:2021 年 1 月 20 日,星期三,上​​午 10:57:11