Board index » delphi » Glyph & beeps

Glyph & beeps

His:
a) how can I cerate variations (length and frequenzy) of the "beep"?
b) Is it easy to create a Glyph to be used in a BitbBtn Button starting
from a
    bmp (bitmap) file?
c) anyone knows where I could find lots of glyphs of all kinds (freeware
or
    purchase)?
Thanks
Enrico
 

Re:Glyph & beeps


a)

I have answered that answer already in the multimedia newsgroup.

Here it is again:

Sound Procedure for Delphi  (for the PC-Speaker, like in Turbo Pascal)

(The following procedures don't work with Windows NT. )
----------------------------------------------------------------------------
procedure SetPort(address, Value:Word);
var
    bValue: byte;
begin
  bValue := trunc(Value and 255);
  asm
    mov dx, address
    mov al, bValue
    out dx, al
  end;
end;

function GetPort(address:word):word;
var
    bValue: byte;
begin
  asm
    mov dx, address
    in al, dx
    mov bValue, al
  end;
  GetPort := bValue;
end;

procedure NoSound;
var
  Value: Word;
begin
    Value := GetPort($61) and $FC;
    SetPort($61, Value);
end;

Procedure Sound(Freq, Delay : integer);
VAR
      firsttick  : Dword;

procedure DoSound(Freq : Word);
var
    B : Byte;
begin
    if Freq > 18 then
        begin
            Freq := Word(1193181 div LongInt(Freq));
            B := Byte(GetPort($61));

            if (B and 3) = 0 then
               begin
                   SetPort($61, Word(B or 3));
                   SetPort($43, $B6);
               end;

            SetPort($42, Freq);
            SetPort($42, Freq shr 8);
        end;
end;

begin
  firsttick := gettickcount;
  repeat
    DoSound(Freq);
    Application.ProcessMessages;
  until (gettickcount >= firsttick + Delay);
end;

----------------------------------------------------------------------------

Example :

Sound(400,1000)

NoSound;  // don't forget it !
----------------------------------------------------------------------------

Hope it helps

Tom

Quote
Enrico P. <eperg...@sympatico.ca> wrote in message

news:395ABB0A.4EE1E1F7@sympatico.ca...
Quote
> His:
> a) how can I cerate variations (length and frequenzy) of the "beep"?
> b) Is it easy to create a Glyph to be used in a BitbBtn Button starting
> from a
>     bmp (bitmap) file?
> c) anyone knows where I could find lots of glyphs of all kinds (freeware
> or
>     purchase)?
> Thanks
> Enrico

Re:Glyph & beeps


Quote
> "Enrico P." wrote:

> a) how can I cerate variations (length and frequenzy) of the "beep"?

This is available only under WinNT (check 'Beep' in win32.hlp):

  Windows.Beep(f, d)    // f = frequency in Hz, d = duration in msec

Quote
> b) Is it easy to create a Glyph to be used in a BitbBtn Button        > starting from a bmp (bitmap) file?

Not sure what you mean. Glyphs are bitmaps. Create them at will e.g.
with ImageEditor.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5
Direct replies mailto:p...@augsburg.netsurf.de

Re:Glyph & beeps


c)

A Glyph collection:

http://home1.inet.tele.dk/oz1lln/glyphs.htm

Quote
Andreas Pawlik <no~j...@augsburg.netsurf.de> wrote in message

news:395B2487.90CAE477@augsburg.netsurf.de...
Quote
> > "Enrico P." wrote:

> > a) how can I cerate variations (length and frequenzy) of the "beep"?

> This is available only under WinNT (check 'Beep' in win32.hlp):

>   Windows.Beep(f, d)    // f = frequency in Hz, d = duration in msec

> > b) Is it easy to create a Glyph to be used in a BitbBtn Button        >

starting from a bmp (bitmap) file?
Quote

> Not sure what you mean. Glyphs are bitmaps. Create them at will e.g.
> with ImageEditor.
> ________
> Andreas
> Delphi 5.01 Pro, NT4.0 Sp5
> Direct replies mailto:p...@augsburg.netsurf.de

Other Threads