Как заставить встроеный динамик пищать
Оформил: DeeCo
procedure Sound(Duration: Integer; Freq: Word);
var
Ver: TOsVersionInfo;
begin
Ver.dwOSVersionInfoSize := SizeOf(Ver);
GetVersionEx(Ver);
if ver.dwPlatformId = VER_PLATFORM_WIN32_NT then
Windows.Beep(Duration, Freq)
else
begin
asm
mov al,0b6H
out 43H,al
mov ax,Freq
out 42h,al
ror ax,8
out 42h,al
in al,61H
or al,03H
out 61H,al
end;
sleep(Duration);
asm
in al,61H
and al,0fcH
out 61H,al
end;
end;
end;
|