|
Try
pDSCaptureBuffer = New CaptureBuffer(dscheckboxd, cap)
InputFormatSupported(iIndex) = True
Catch
InputFormatSupported(iIndex) = False
End Try
pDSCaptureBuffer.Dispose()
Next iIndex
Cursor = Cursors.Default
End Sub ''''ScanAvailableInputFormats
Private Sub GetWaveFormatFromIndex(ByVal Index As Integer, ByRef format As WaveFormat)
''''-----------------------------------------------------------------------------
'''' Name: GetWaveFormatFromIndex()
'''' Desc: Returns 20 different wave formats based on Index
''''-----------------------------------------------------------------------------
Dim SampleRate As Integer = Index / 4
Dim iType As Integer = Index Mod 4
Select Case SampleRate
Case 0
format.SamplesPerSecond = 48000
Case 1
format.SamplesPerSecond = 44100
Case 2
format.SamplesPerSecond = 22050
Case 3
format.SamplesPerSecond = 11025
Case 4
format.SamplesPerSecond = 8000
End Select
Select Case iType
Case 0
format.BitsPerSample = 8
format.Channels = 1
Case 1
format.BitsPerSample = 16
format.Channels = 1
Case 2
format.BitsPerSample = 8
format.Channels = 2
Case 3
format.BitsPerSample = 16
format.Channels = 2
End Select
format.BlockAlign = CShort(format.Channels * (format.BitsPerSample / 8))
format.AverageBytesPerSecond = format.BlockAlign * format.SamplesPerSecond
End Sub ''''GetWaveFormatFromIndex
Private Shared Function ConvertWaveFormat 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |