RE:Hacer sonar la bocina interna de la computadora
Encontré un codigo de muestra que lo hace pero no lo he comprobado, aunque aqui se estan metiendo con ensamblador, aqui te lo dejo, además tambien la pagina donde lo encontré
http://www.latiumsoftware.com/en/pascal/0048.php#5
Es el punto número 5 del indice de la página
procedure SpeakerSound(Frequency: word; Duration: longint);
// Copyright (c) 2003 Ernesto De Spirito
// Visit: http://www.latiumsoftware.com
// Plays a tone thru the PC speaker using the 8253/8254
// Counter/Timer chip and the 8255 Programmable Peripheral
// Interface (PPI) chip on the motherboard.
// NOTE: This code won't work under Windows NT/2000/XP.
asm
push edx // Push Duration on the stack (for Sleep)
mov cx, ax // CX := Frequency;
// Prepare the 8253/8254 to receive the frequency data
mov al, $B6 // Function: Expect frequency data
out $43, al // Write to Timer Control Register
// Compute the frequency data
mov dx, $14 // DX:AX = $144F38
mov ax, $4F38 // = 1331000
div cx // AX := 1331000 / Frequency;
// Send the frequency data to the 8253/8254 Counter/Timer chip
out $42, al // Write low byte to the Frequency Address
mov al, ah // AL := High byte of AX
out $42, al // Write high byte to the Frequency Address
// Tell the 8255 PPI to start the sound
in al, $61 // Read Port B of the 8255 PPI
or al, $03 // Set bits 0 and 1:
// bit 0 --> use the 8253/8254
// bit 1 --> turn speaker on
out $61, al // Write to Port B of the 8255 PPI
// Wait
call Sleep // Sleep(Duration); // requires Windows unit
// Tell the 8255 PPI to stop the sound
in al, $61 // Read Port B of the 8255 PPI
and al, NOT 2 // Clear bit 1 (turn speaker off)
out $61, al // Write to Port B of the 8255 PPI
end;
Sample call:
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
Randomize;
for i := 1 to 3 do
SpeakerSound(Random(900)+100, 200);
end;