Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No sound

Status
Not open for further replies.

Utpal

Programmer
Mar 28, 2002
19
IN
Hi everybody,
I have Foxpro 2.6a for Windows on Windows 2000 Professional. Executing the command "?? CHR(7)" does not produce any sound. Is there a solution to this ?
 
Try setting the following to get a more "Windows" like tone:

SET BELL TO "C:\WINDOWS\CHIME.WAV" && or any wave you like.

Then issue:

?? CHR(7)

You might also try:

? CHR(7)

Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Thanks Scott. I know this works, but only if a sound card and multi-media speakers are present. Mine has them, but most computers in India don't, especially in offices. I want the sound to come from the PC speaker which is present in most computers. I have developed a standard Inventory package for which I want that. It used to work fine on Windows 3.11 and Windows 98. The problem occurs in Windows 2000.
 
Utpal,
I see your point... in place of your ? CHR(7), try this routine instead:

=ALERTONE(3)


(Then, in your &quot;Common&quot; procedure file (whatever file you issue a &quot;SET PROCEDURE TO <filename>&quot; command, add this Procedure:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* This procedure is used to establish the alert tone used
* by functions which use an audable alert when needed.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

PROCEDURE ALERTONE

PARAMETER M.ALERTCOUNT
*
PRIVATE M.ALERTCOUNT
*
IF PARAMETERS() < 1
M.ALERTCOUNT = 1
ENDIF
*
FOR M.SOUNDCOUNT = 1 TO M.ALERTCOUNT
SET BELL TO 1650-(18*M.SOUNDCOUNT), 3
?? CHR(7)
SET BELL TO 650-(5*M.SOUNDCOUNT),3
?? CHR(7)
ENDFOR (M.SOUNDCOUNT)
*
SET BELL TO
*
RELEASE M.ALERTCOUNT
RELEASE M.SOUNDCOUNT


This sends 3 tones to the PC speaker. Due to &quot;Speed&quot; and &quot;Timing&quot; issues, single tones are sometimes missed by faster processor's or some OS's.


Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Thanks Scott, but your code did not work. Still there is no sound.
 
Hmmmm... very odd. This may sound stupid, but have you verified the PC speaker is attached and functioning in the machine?
Best Regards,
Scott

Please let me know if this has helped [hammer]
 
It's not clear whether you are checking this out on a machine without a sound card. Many times the presents of one will &quot;disconnect&quot; the PC speaker. Also, not all OEM's supply a Windows Speaker Driver, and I don't believe MS officially supports one anymore. Since NT / 2000 / XP don't allow direct access to the hardware, you may not be able to use any &quot;DOS&quot; like solutions.

Rick
 
Rick,
I'm actually running a FP2.6 app on WinXP Pro, and my calls to the &quot;ALTERONE&quot; procedure I have above still work...

I also have a SoundBlaster LIVE! and a Delta66 ProAudio board in the same machine, with the PC speaker.

That said, I would agree very much with your statement that some audio cards do, however, override your pc speaker.

As far as I am aware (though, I could be wrong), the PC Speaker doesn't require a seperate &quot;Driver&quot; to function in Windows, as it is a call to a specific address, not a call to an IRQ.

Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Utpal,
Some computers do not come with a PC speaker
anymore.I think It's absurb but I have 7
Gateway Profile III's that do not have them,
or the software to drive them. therefore will
not respond at all to any chr(7) command.

Hope this helps

Charlie Huff
CJ's Homecenter
From the Star Trek Generation
 
Thanks to all ! I do have a PC speaker. I am sure about that because in FoxPro for DOS 2.6, it produces sound with the same ?? Chr(7) command. Maybe I'll have to look for a PC speaker driver for Windows 2000.
 
I haven't checked out that on a machine without a sound card. I only tried it out on my computer which has a sound card.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top