Solved

PC Speaker Access

Posted on 1998-08-26
4
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SCANF - LIMIT THE NUMBER OF CHARARACTERS 1 68
Finding a good hash function 4 130
change colour of repeater control in asp.net c# 7 138
gdb doesn't stop on breakpoint 2 114
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

726 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