Solved

PC Speaker Access

Posted on 1998-08-26
4
270 Views
Last Modified: 2010-04-15
Hi Everyone,

  I'm writing an opengl program for Windows 95 and want to add some sound.  The "Beep" and "MessageBeep" functions work but are to slow with response time (it is a real time simulation I'm writing).  

  I've come along some faq's that have told me about how the speaker is addressed on port 21 and things like that.  I haven't done any hardware programming before and have not been able to find C code to learn from (although I have found lots of pascal code).  

  If anyone knows functions the names of some functions, url's, or even routines that would help, I would greatly appreciate it.

  -David

0
Comment
Question by:dpnguyen
  • 2
4 Comments
 
LVL 1

Expert Comment

by:eburley
ID: 1252317
I was gonna work up an example from some old asm code, but my code ended up throwing a priveleged instruction, and that's probably why Beep and MessageBeep are slow.
0
 
LVL 2

Expert Comment

by:duneram
ID: 1252318
are you trying to do sound via a soundcard or just directly thru the speaker?
0
 
LVL 2

Accepted Solution

by:
duneram earned 100 total points
ID: 1252319
Take a look at article : Q138857  on the FastTips:

this article shows how to install a PC speaker driver on Win95 to play wav files and stuff like that.  The name of the driver is  (SPEAKER.DRV)and its available through Microsoft Download Service (MSDL)

This article explains why programs run slow or hang when trying to use the pc speaker in win95:  Q134591

Games Using the PC Speaker May Run Slowly or Hang
Last reviewed: August 23, 1995
Article ID: Q134591  
The information in this article applies to:
Microsoft Windows 95


SYMPTOMS
When you run a game that uses the PC speaker to play sounds, your computer may run slowly or stop responding (hang).



CAUSE
This problem can occur if the game tries to set the timer chip to a rate faster than Windows 95 can handle. When this occurs, the game does not receive timer ticks as rapidly as it expects, causing the game to run slowly.



RESOLUTION
To correct this problem, configure the game to run in MS-DOS mode. To do so, follow these steps:


In Windows Explorer or My Computer, use the right mouse button to click the game's executable file, and then click Properties on the menu that appears.

On the Program tab, click Advanced.

Click the MS-DOS Mode check box to select it, and then click OK.

To run the program with the new configuration, double-click the game's executable file. Do not type the game's executable filename at an MS-DOS prompt to start the game.



Microsoft FastTips is available 24 hours a day, 7 days a week, from a touch-tone telephone. To order items from this catalog, first select the items you want to receive, noting the five- to six-digit number of the Item ID shown below for each item, and then:

          Dial the toll-free FastTips number (800) 936-4300.
          When prompted, select the Win32 Software Development Kit.
          Press one (1) on your phone keypad to select Express Order Service.
          When prompted, select the delivery method, fax.
          When prompted, enter your three-digit area code and seven-digit fax number on your phone keypad.
          When prompted, enter the number of the Item ID and press #, for up to five items.

     When finished, simply hang up. If you have problems receiving a fax, please call (425)
     635-3105.

0
 

Author Comment

by:dpnguyen
ID: 1252320
Duneram:

  Thanks for the reply.  I was looking for a solution that had to do with directly accessing the PC speaker.  All I want it to do is beep, nothing fancy, just a beep, but in real time.  I don't even want to have my program touch the sound card at any time, just the pc speaker.  I just wanted to know if there is way using VC++ to do it.

  Gracias
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now