- Option Explicit
- Private Declare Function cvt_FihoCodec Lib "fihocodec.dll" ( _
- ByVal Source As String, _
- ByVal SourceCodec As Integer, _
- ByVal Target As String, _
- ByVal DestCodec As Integer) As Integer
-
- Private Declare Function cvt_GetConvertProgress Lib "fihocodec.dll" () As Long
- Private Declare Function cvt_StopConvert Lib "fihocodec.dll" () As Long
-
-
- Private Sub Command1_Click()
- On Error Resume Next
- Dim SourceFile As String
- Dim TargetFile As String
- Dim n As Integer
- Dim BeginTime As Date
-
- SourceFile = App.Path + "\test.NTC"
- TargetFile = App.Path + "\Target" + Format(Now, "yyyyMMddHHmmss") + ".Wav"
-
- '' test.ntc => wav
- If Dir(SourceFile) <> "" Then
- BeginTime = Now
- cvt_FihoCodec SourceFile, 3, TargetFile, 0
-
- Do While n < 100 And DateDiff("s", BeginTime, Now) <= 120
- DoEvents
- n = cvt_GetConvertProgress
- Label1 = CStr(n) + "%"
- Loop
-
- cvt_StopConvert
- MsgBox "complete"
- End If
-
- End Sub
复制代码 这个代码调用dll,将NTC转换为wav。是一个图形界面的,我想转为vbs,因为从未接触过,所以只好请大家帮帮忙了! |