以下示例代码使用 vMix 4K 和 Pro 版本中的 vMix 脚本功能。
代码默认在默认录音文件夹 (DocumentsvMixStorage) 中查找新的 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