46553 (565965), страница 3
Текст из файла (страница 3)
i = mciSendString ("status capture bitspersample", mssg, 255, 0)
If i <> 0 Then MsgBox ("Finding resolution failed!")
WaveStatisticsMsg = WaveStatisticsMsg & Str (mssg) & " bits - "
i = mciSendString ("status capture samplespersec", mssg, 255, 0)
If i <> 0 Then MsgBox ("Finding sample rate failed!")
WaveStatisticsMsg = WaveStatisticsMsg & Str (mssg) & " samples per second " & vbCrLf & vbCrLf
End Sub
Public Sub WaveClose ()
Dim rtn As String
Dim i As Long
i = mciSendString ("close capture", rtn, Len (rtn), 0)
If i <> 0 Then MsgBox ("Closing MCI failed!")
End Sub
Public Function WavePosition () As Long
Dim rtn As String
Dim i As Long
Dim pos As String
rtn = Space (255)
pos = Space (255)
i = mciSendString ("set capture time format ms", rtn, Len (rtn), 0)
If i <> 0 Then MsgBox ("Setting format in milliseconds failed!")
i = mciSendString ("status capture position", pos, 255, 0)
If i <> 0 Then MsgBox ("Finding position failed!")
If i <> 0 Then MsgBox ("Error in position")
WavePosition = CLng (pos)
End Function
Public Sub WavePlayFrom (Position As Long)
Dim rtn As String
Dim i As Long
Dim pos As String
pos = CStr (Position)
i = mciSendString ("set capture time format ms", 0&, 0, 0)
If i <> 0 Then MsgBox ("Setting format in milliseconds failed!")
i = mciSendString ("play capture from " & pos, rtn, Len (rtn), 0)
If i <> 0 Then MsgBox ("Playing from indicated position failed!")
If i <> 0 Then MsgBox ("Play from position doesn't work... ")
End Sub
Interface in Action