我在windowspowershell中输入了Import-Module WhisperPS -DisableNameChecking$Model = Import-WhisperModel CUserswolfydwDesktopwhisperWhisperDesktopggml-large-v1bin$Results = dir -include wma wav mp3Transcribe-
您可以按照以下方式修改代码:
Import-Module WhisperPS -DisableNameChecking
$Model = Import-WhisperModel C:\Users\wolfydw\Desktop\whisper\WhisperDesktop\ggml-large-v1.bin
$Results = dir .* -include *.wma, *.wav, *.mp3
foreach ($i in $Results) { $txt = $i.BaseName + ".txt" Transcribe-File $Model -language zh -inputFile $i.FullName | Export-Text $txt -timestamps }
这里将foreach循环放在了主代码块中,并使用了$i.BaseName来获取文件名,同时将Transcribe-File和Export-Text合并到了一个命令中。
原文地址: http://www.cveoy.top/t/topic/bGj3 著作权归作者所有。请勿转载和采集!