ViaThinkSoft CodeLib
This article is in:
CodeLib → Programming aids → Delphi
32/64 Bit Delphi (Windows 95+):
16 Bit Delphi (Windows 3.x):
How it works:
uses
MMSystem, Windows;
function Supports16BitWaveout: boolean;
var
caps: TWaveOutCaps;
begin
ZeroMemory(@caps, sizeof(caps));
waveOutGetDevCaps(0, @caps, sizeof(caps));
result := caps.dwFormats and $CCCCCCCC <> 0;
end;
16 Bit Delphi (Windows 3.x):
uses
MMSystem;
function Supports16BitWaveout: boolean;
var
caps: TWaveOutCaps;
begin
waveOutGetDevCaps(0, @caps, sizeof(caps));
result := caps.dwFormats and $CCCC <> 0;
end;
How it works:
{ 11.025 kHz, Mono, 8-bit } WAVE_FORMAT_1M08 00000001 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 11.025 kHz, Stereo, 8-bit } WAVE_FORMAT_1S08 00000002 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 11.025 kHz, Mono, 16-bit } WAVE_FORMAT_1M16 00000004 and CCCCCCCC = 00000004 ==> "16 Bit"
{ 11.025 kHz, Stereo, 16-bit } WAVE_FORMAT_1S16 00000008 and CCCCCCCC = 00000008 ==> "16 Bit"
{ 22.05 kHz, Mono, 8-bit } WAVE_FORMAT_2M08 00000010 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 22.05 kHz, Stereo, 8-bit } WAVE_FORMAT_2S08 00000020 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 22.05 kHz, Mono, 16-bit } WAVE_FORMAT_2M16 00000040 and CCCCCCCC = 00000040 ==> "16 Bit"
{ 22.05 kHz, Stereo, 16-bit } WAVE_FORMAT_2S16 00000080 and CCCCCCCC = 00000080 ==> "16 Bit"
{ 44.1 kHz, Mono, 8-bit } WAVE_FORMAT_44M08 00000100 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 44.1 kHz, Stereo, 8-bit } WAVE_FORMAT_44S08 00000200 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 44.1 kHz, Mono, 16-bit } WAVE_FORMAT_44M16 00000400 and CCCCCCCC = 00000400 ==> "16 Bit"
{ 44.1 kHz, Stereo, 16-bit } WAVE_FORMAT_44S16 00000800 and CCCCCCCC = 00000800 ==> "16 Bit"
{ 48 kHz, Mono, 8-bit } WAVE_FORMAT_48M08 00001000 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 48 kHz, Stereo, 8-bit } WAVE_FORMAT_48S08 00002000 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 48 kHz, Mono, 16-bit } WAVE_FORMAT_48M16 00004000 and CCCCCCCC = 00004000 ==> "16 Bit"
{ 48 kHz, Stereo, 16-bit } WAVE_FORMAT_48S16 00008000 and CCCCCCCC = 00008000 ==> "16 Bit"
{ 96 kHz, Mono, 8-bit } WAVE_FORMAT_96M08 00010000 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 96 kHz, Stereo, 8-bit } WAVE_FORMAT_96S08 00020000 and CCCCCCCC = 00000000 ==> "8 Bit"
{ 96 kHz, Mono, 16-bit } WAVE_FORMAT_96M16 00040000 and CCCCCCCC = 00040000 ==> "16 Bit"
{ 96 kHz, Stereo, 16-bit } WAVE_FORMAT_96S16 00080000 and CCCCCCCC = 00080000 ==> "16 Bit"
Daniel Marschall
ViaThinkSoft Co-Founder
ViaThinkSoft Co-Founder