Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
WAVEFORMATEX (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential)]
public struct WaveFormatExtensible
{
public ushort wFormatTag;
public ushort nChannels;
public uint nSamplesPerSec;
public uint nAvgBytesPerSec;
public ushort nBlockAlign;
public ushort wBitsPerSample;
public ushort cbSize;
public ushort wValidBitsPerSample;
public uint dwChannelMask;
public Guid SubFormat;
}
struct WAVEFORMATEX
{
public ushort wFormatTag;
public ushort nChannels;
public uint nSamplesPerSec;
public uint nAvgBytesPerSec;
public ushort nBlockAlign;
public ushort wBitsPerSample;
public ushort cbSize;
}
VB Definition:
<StructLayout(LayoutKind.Sequential, pack:=1)> Public Structure WAVEFORMATEXTENSIBLE
Dim Format As WAVEFORMATEX
'union {
'WORD wValidBitsPerSample;
'WORD wSamplesPerBlock;
'WORD wReserved;
';} Samples;
Dim wUnionSamples As UInt16
Dim dwChannelMask As UInteger
Dim SubFormat As Guid
Friend Structure WAVEFORMATEX
Dim wFormatTag As UShort
Dim nChannels As UShort
Dim nSamplesPerSec As UInteger
Dim nAvgBytesPerSec As UInteger
Dim nBlockAlign As UShort
Dim wBitsPerSample As UShort
Dim cbSize As UShort
Public Sub SetAutoParams()
nBlockAlign = CUShort(nChannels * (wBitsPerSample \ 8))
nAvgBytesPerSec = nBlockAlign * nSamplesPerSec
cbSize = CUShort(Marshal.SizeOf(Me))
End Sub
End Structure
User-Defined Field Types:
None.
Notes:
VB - wUnionSamples replaces the union of 3 values commented out above it as a union is not possible in VB - just put the value into wUnionSamples for whichever of the wValidBitsPerSample/wSamplesPerBlock/wReserved required based on the SubFormat.
The VB.Net implementation includes a subroutine, SetAutoParams, that will set automatically the remaining fields of the structure, according to MSDN specifications.
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.