'''' Create the capture buffer
dscheckboxd.BufferBytes = CaptureBufferSize
InputFormat.FormatTag = WaveFormatTag.Pcm
dscheckboxd.Format = InputFormat '''' Set the format during creatation
applicationBuffer = New CaptureBuffer(dscheckboxd, Cap)
NextCaptureOffset = 0
InitNotifications()
End Sub ''''CreateCaptureBuffer
Sub InitNotifications()
''''-----------------------------------------------------------------------------
'''' Name: InitNotifications()
'''' Desc: Inits the notifications on the capture buffer which are handled
'''' in the notify thread.
''''-----------------------------------------------------------------------------
If Nothing Is applicationBuffer Then
Throw New ArgumentNullException
End If
'''' Create a thread to monitor the notify events
If Nothing Is NotifyThread Then
NotifyThread = New Thread(New ThreadStart(AddressOf WaitThread))
NotifyThread.Start()
'''' Create a notification event, for when the sound stops playing
NotificationEvent = New AutoResetEvent(False)
End If
'''' Setup the notification positions
Dim i As Integer
For i = 0 To NumberRecordNotifications - 1
PositionNotify(i).Offset = NotifySize * i + NotifySize - 1
PositionNotify(i).EventNotifyHandle = NotificationEvent.Handle
Next i
applicationNotify = New Notify(applicationBuffer)
'''' Tell DirectSound when to notify the app. The notification will come in the from
'''' of signaled events that are handled in the notify thread.
applicationNotify.SetNotificationPositions(PositionNotify, NumberRecordNotifications)
End Sub ''''InitNotifications
Private Sub WaitThread()
While Created
''''Sit here and wait for a message to arrive
NotificationEvent.WaitOne(Timeout.Infinite, True)
RecordCapturedData()
End While
End Sub ''''WaitThread
Sub RecordCapturedData()
''''-----------------------------------------------------------------------------
'''' Name: RecordCapturedData()
'''' Desc: Copies data from the capture buffer to the output buffer
  上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> [聊天工具]让IE 7也用上鼠标手势 [常用软件]IE 7出炉,Firefox 2当道.谁才是“王者”? [常用软件]绕过WGA安装IE 7 Beta3 5450 [VB.NET程序]VB.NET实现DirectSound9 (8) 音效控制器 [VB.NET程序]VB.NET实现DirectSound9 (6) 声音特效 [VB.NET程序]VB.NET 实现DirectSound9 (5) DS3D2 [VB.NET程序]用VB.Net实现DirectSound9 (4) DS3D [VB.NET程序]VB.NET 使用DirectSound 3 [VB.NET程序]学习笔记,VB.NET使用DirectSound9 (2) [VB.NET程序]学习笔记,VB.NET使用DirectSound9 (1)
|