'''' Figure out how many bytes there will be per sample.
If 8 = InputFormat.BitsPerSample And 1 = InputFormat.Channels Then
shBytesPerSample = 1
ElseIf 8 = InputFormat.BitsPerSample And 2 = InputFormat.Channels Or (16 = InputFormat.BitsPerSample And 1 = InputFormat.Channels) Then
shBytesPerSample = 2
ElseIf 16 = InputFormat.BitsPerSample And 2 = InputFormat.Channels Then
shBytesPerSample = 4
End If
'''' Fill in the riff info for the wave file.
Writer.Write(ChunkRiff)
Writer.Write(nLength)
Writer.Write(ChunkType)
'''' Fill in the format info for the wave file.
Writer.Write(ChunkFmt)
Writer.Write(nFormatChunkLength)
Writer.Write(shPad)
Writer.Write(InputFormat.Channels)
Writer.Write(InputFormat.SamplesPerSecond)
Writer.Write(InputFormat.AverageBytesPerSecond)
Writer.Write(shBytesPerSample)
Writer.Write(InputFormat.BitsPerSample)
'''' Now fill in the data chunk.
Writer.Write(ChunkData)
Writer.Write(CInt(0)) '''' The sample length will be written in later.
End Sub ''''CreateRIFF
Sub CreateCaptureBuffer()
''''-----------------------------------------------------------------------------
'''' Name: CreateCaptureBuffer()
'''' Desc: Creates a capture buffer and sets the format
''''-----------------------------------------------------------------------------
Dim dscheckboxd As New CaptureBufferDescription
If Not Nothing Is applicationNotify Then
applicationNotify.Dispose()
applicationNotify = Nothing
End If
If Not Nothing Is applicationBuffer Then
applicationBuffer.Dispose()
applicationBuffer = Nothing
End If
If 0 = InputFormat.Channels Then
Return
End If
'''' Set the notification size
NotifySize = IIf(1024 > InputFormat.AverageBytesPerSecond / 8, 1024, InputFormat.AverageBytesPerSecond / 8)
NotifySize -= NotifySize Mod InputFormat.BlockAlign
'''' Set the buffer sizes
CaptureBufferSize = NotifySize * NumberRecordNotifications
上一页 [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)
|