🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.multimedia
15 messages
15 total messages Started by ���� Tue, 14 Nov 2006 09:30
Easiest way to beep the speakers
#218
Author: ����
Date: Tue, 14 Nov 2006 09:30
5 lines
939 bytes
Hi
I want to send a beep to both Internal Case Speaker and also Sound Cart
But the easiest way, API only , no component , no OCX, etc...
is there any idea?
thanks
Re: Easiest way to beep the speakers
#219
Author: Hans Galema
Date: Tue, 14 Nov 2006 10:42
7 lines
1024 bytes
���� wrote:

> I want to send a beep to both Internal Case Speaker and also Sound Cart

Beep(); ?

Hans.
Re: Easiest way to beep the speakers
#220
Author: ????
Date: Tue, 14 Nov 2006 19:45
12 lines
1276 bytes
I'm using win98 and in any case , any number for freq or mili-secs it just
play a wave, I guess windows error !!!

"Hans Galema" <notused@notused.nl> wrote in message
news:45599df3$1@newsgroups.borland.com...
> ���� wrote:
>
> > I want to send a beep to both Internal Case Speaker and also Sound Cart
>
> Beep(); ?
>
> Hans.
Re: Easiest way to beep the speakers
#221
Author: Hans Galema
Date: Tue, 14 Nov 2006 22:38
7 lines
1255 bytes
???? wrote:
> I'm using win98 and in any case , any number for freq or mili-secs it just
> play a wave, I guess windows error !!!

Hehhh? Where are you talking about?

Hans.
Re: Easiest way to beep the speakers
#222
Author: Mark Jacobs
Date: Fri, 17 Nov 2006 11:41
22 lines
1625 bytes
���� wrote:
> I want to send a beep to both Internal Case Speaker and also Sound
> Cart But the easiest way, API only , no component , no OCX, etc...
> is there any idea?

Try Beep(3000,500); for sound on the PC speaker (works for me under XP).

Also,

PlaySound("SystemQuestion",HInstance,SND_ALIAS|SND_ASYNC);

plays the System Question sound (whatever that is configured as) on the proper 
speakers (attached to the sound card)

HTH,
-- 

To be aware is to care.
-
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
Re: Easiest way to beep the speakers
#223
Author: 4N
Date: Fri, 17 Nov 2006 17:16
28 lines
1786 bytes
He wants to make beep the internal (crappy) speaker so he doesn't have to 
turn on speakers likely

"Mark Jacobs" <http://www.jacobsm.com/mjmsg?Borland%20Newsgroup> ha scritto 
nel messaggio news:455d9fec$1@newsgroups.borland.com...
> ���� wrote:
>> I want to send a beep to both Internal Case Speaker and also Sound
>> Cart But the easiest way, API only , no component , no OCX, etc...
>> is there any idea?
>
> Try Beep(3000,500); for sound on the PC speaker (works for me under XP).
>
> Also,
>
> PlaySound("SystemQuestion",HInstance,SND_ALIAS|SND_ASYNC);
>
> plays the System Question sound (whatever that is configured as) on the 
> proper speakers (attached to the sound card)
>
> HTH,
> -- 
>
> To be aware is to care.
> -
> Mark Jacobs
> DK Computing
> http://www.dkcomputing.co.uk
> 
Re: Easiest way to beep the speakers
#224
Author: 4N
Date: Fri, 17 Nov 2006 17:29
27 lines
1690 bytes
Beep works also without parameters

"Mark Jacobs" <http://www.jacobsm.com/mjmsg?Borland%20Newsgroup> ha scritto 
nel messaggio news:455d9fec$1@newsgroups.borland.com...
> ���� wrote:
>> I want to send a beep to both Internal Case Speaker and also Sound
>> Cart But the easiest way, API only , no component , no OCX, etc...
>> is there any idea?
>
> Try Beep(3000,500); for sound on the PC speaker (works for me under XP).
>
> Also,
>
> PlaySound("SystemQuestion",HInstance,SND_ALIAS|SND_ASYNC);
>
> plays the System Question sound (whatever that is configured as) on the 
> proper speakers (attached to the sound card)
>
> HTH,
> -- 
>
> To be aware is to care.
> -
> Mark Jacobs
> DK Computing
> http://www.dkcomputing.co.uk
> 
Re: Easiest way to beep the speakers
#228
Author: ����
Date: Sun, 19 Nov 2006 19:49
44 lines
2257 bytes
If I de-attach the sound card under WinXP
then internal speaker will beep !!!
but I want to beep it when I have the sound card attached to mainboard.

You know?
I want to alert the user, when he made a mistake
a ShowMessage, an Image visibility and both Internal Speaker and Soudncard
Speaker will alert him !!
I wonder how to beep the internal speaker
Thanks everybody


"4N" <xxxx@yyyy.zzz> wrote in message
news:455df52f@newsgroups.borland.com...
> Beep works also without parameters
>
> "Mark Jacobs" <http://www.jacobsm.com/mjmsg?Borland%20Newsgroup> ha
scritto
> nel messaggio news:455d9fec$1@newsgroups.borland.com...
> > ���� wrote:
> >> I want to send a beep to both Internal Case Speaker and also Sound
> >> Cart But the easiest way, API only , no component , no OCX, etc...
> >> is there any idea?
> >
> > Try Beep(3000,500); for sound on the PC speaker (works for me under XP).
> >
> > Also,
> >
> > PlaySound("SystemQuestion",HInstance,SND_ALIAS|SND_ASYNC);
> >
> > plays the System Question sound (whatever that is configured as) on the
> > proper speakers (attached to the sound card)
> >
> > HTH,
> > --
> >
> > To be aware is to care.
> > -
> > Mark Jacobs
> > DK Computing
> > http://www.dkcomputing.co.uk
> >
>
>
Re: Easiest way to beep the speakers
#229
Author: Bruce Salzman
Date: Mon, 20 Nov 2006 14:55
22 lines
1577 bytes
"����" <oh_dont@spam.me> wrote in message 
news:4561b3e0@newsgroups.borland.com...
> If I de-attach the sound card under WinXP
> then internal speaker will beep !!!
> but I want to beep it when I have the sound card attached to 
> mainboard.
>
> You know?
> I want to alert the user, when he made a mistake
> a ShowMessage, an Image visibility and both Internal Speaker and 
> Soudncard
> Speaker will alert him !!
> I wonder how to beep the internal speaker
> Thanks everybody

Try

::MessageBeep(-1);

-- 
Bruce 
Re: Easiest way to beep the speakers
#231
Author: 4N
Date: Mon, 20 Nov 2006 17:16
33 lines
2075 bytes
None of the APIs I know worked for me.
Actually, I think I read somewhere that APIs of windows use the external 
speaker if a soundcard is present (I can't recall if that was different in 
Win9x).
You should try asking in some assembler related NG to access output ports 
directly maybe.
btw if you come up to a solution before us it'd be nice to know it.


" Bruce Salzman" <bruce@nospam.org> ha scritto nel messaggio 
news:4561c1c9$1@newsgroups.borland.com...
>
> "����" <oh_dont@spam.me> wrote in message 
> news:4561b3e0@newsgroups.borland.com...
>> If I de-attach the sound card under WinXP
>> then internal speaker will beep !!!
>> but I want to beep it when I have the sound card attached to mainboard.
>>
>> You know?
>> I want to alert the user, when he made a mistake
>> a ShowMessage, an Image visibility and both Internal Speaker and 
>> Soudncard
>> Speaker will alert him !!
>> I wonder how to beep the internal speaker
>> Thanks everybody
>
> Try
>
> ::MessageBeep(-1);
>
> -- 
> Bruce
> 
Re: Easiest way to beep the speakers
#232
Author: ����
Date: Tue, 21 Nov 2006 20:16
3 lines
1173 bytes
> btw if you come up to a solution before us it'd be nice
Can I know your system configuration?
HDes? OS? etc?
Re: Easiest way to beep the speakers
#233
Author: 4N
Date: Wed, 22 Nov 2006 09:18
12 lines
1494 bytes
I don't think I have to go that far as giving anyone what's "exactly" my PC 
configuration but I can tell you I use XP with a soundblaster Live.


"����" <oh_dont@spam.me> ha scritto nel messaggio 
news:456402fc@newsgroups.borland.com...
>> btw if you come up to a solution before us it'd be nice
> Can I know your system configuration?
> HDes? OS? etc?
>
>
> 
Re: Easiest way to beep the speakers
#234
Author: Simon Owen
Date: Sat, 25 Nov 2006 03:55
47 lines
2320 bytes
Right, dug out my old copy of PC intern for you.

void HardBeep(int Freq, int Duration)
{
    OSVERSIONINFO osInfo;
    osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    GetVersionEx(&osInfo);

    if( osInfo.dwMajorVersion >= 5 ||
        osInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
    {
        Beep(Freq,Duration);
        return;
    }
    asm {
        mov eax,1193181
        xor edx,edx
        mov ebx,dword ptr [Freq]
        div ebx
        pushd eax
        mov al,182
        out 0x43,al
        pop eax
        out 0x42,al
        mov al,ah
        out 0x42,al
        in al,0x61
        or al,3
        out 0x61,al
    }
    Sleep(Duration);
    asm {
        in al,0x61
        and al,0xfc
        out 0x61,al
    }
}

The above function basically does the Beep command under Win9x as it does 
for NT and above. On an NT based system it simply calls the Beep command. If 
under any NT system this produces a beep on the sound card, then its because 
your sound card drivers are intercepting commands to the internal speaker in 
an attempt to be helpful.

I've tested the above on WinXP and Win98 with an audigy sound card and the 
sound card was never used. 
Re: Easiest way to beep the speakers
#236
Author: ����
Date: Sun, 26 Nov 2006 21:51
1 lines
1141 bytes
Exactly what I was needing :-) thanks very much
Re: Easiest way to beep the speakers
#235
Author: 4N
Date: Sun, 26 Nov 2006 22:53
3 lines
1314 bytes
> Right, dug out my old copy of PC intern for you.

thanks a lot, I'm gonna try it right away! 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads