이건 그전에 써봤는데 일반적으로 스피커를 이용해서 하는 비프음이랍니다...
버튼을 눌렀을때 나오는 띵~소리 같은거...
제가 원하는건 컴퓨터 자체에서 나오는 비프음을 말하는거랍니다..
삐~ 이런 소리....
^^
조준회 님이 쓰신 글 :
: 빌더의 헬프에서 퍼왔씁니다.
: -----------------------------------------------------------
: Generates a standard beep using the computer speaker.
:
: Unit
:
: Sysutils
:
: Category
:
: miscellaneous routines
:
: extern PACKAGE void __fastcall Beep(void);
:
: Description
:
: Beep calls the Windows API MessageBeep.
:
:
:
:
: 컴투맨 님이 쓰신 글 :
: : 에러 체크나 알림을 하기 위해서 스피커를 이용하지 않고,
: : 컴퓨터 시스템비프음을 사용하고 싶은데 방법을 모르겠습니다.
: :
: : 아시는 분은 꼭 좀 가르쳐 주세요^^
: :
: : 아래는 유사한 소스를 구해 해봤는데 에러가 나더군요.
: : 함 살펴봐 주세요...
: :
: : <소스>
: : unit Unit1;
: :
: : interface
: :
: : uses
: : Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
: : StdCtrls;
: :
: : type
: : TForm1 = class(TForm)
: : Button1: TButton;
: : procedure Button1Click(Sender: TObject);
: : private
: : { Private declarations }
: : public
: : { Public declarations }
: : end;
: :
: : var
: : Form1: TForm1;
: :
: : implementation
: :
: : {$R *.DFM}
: :
: : procedure BeepStart(pitch:SMALLINT);
: : asm
: : mov bx, pitch
: : mov ax, 34DDh
: : mov dx, 0012h
: : cmp dx, bx
: : jnb @stop
: : div bx
: : mov bx, ax
: : in al, 61h
: : test al, 3
: : jne @j1
: : or al, 3
: : out 61h, al
: : mov al, 0B6h
: : out 43h, al
: : @j1:
: : mov al, bl
: : out 42h, al
: : mov al, bh
: : out 42h, al
: : @stop:
: : end;
: :
: : // Sound 중지
: : procedure BeepStop;
: : asm
: : in al,61H
: : and al, 0fcH
: : out 61H, al
: : end;
: :
: :
: : procedure TForm1.Button1Click(Sender: TObject);
: : begin
: : BeepStart(100); // 주파수 싸이클수(양수값만 허용), 높을수록 저음
: : Sleep(100); // (delay) 1초간 지연
: : BeepStop;
: : end;
: :
: : end.
|