home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19443 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.8 KB

  1. Xref: sparky comp.lang.c:19443 comp.lang.c++:18854 comp.lang.misc:4099
  2. Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.misc
  3. Path: sparky!uunet!brunix!cs.brown.edu!sj
  4. From: sj@cs.brown.edu (Shuang Ji)
  5. Subject: Re: How to turn PC speaker off?
  6. Message-ID: <1993Jan8.195256.27080@cs.brown.edu>
  7. Sender: news@cs.brown.edu
  8. Organization: Brown Computer Science Dept.
  9. References: <C0Gz8y.H0@cmie.ernet.in> <1993Jan8.004849.1660@jwminhh.hanse.de>
  10. Date: Fri, 8 Jan 1993 19:52:56 GMT
  11. Lines: 52
  12.  
  13. In article <1993Jan8.004849.1660@jwminhh.hanse.de>, wieck@jwminhh.hanse.de (Jan Wieck) writes:
  14. |> rs@cmie.ernet.in (Rajappa Iyer) writes:
  15. |> : wieck@jwminhh.hanse.de (Jan Wieck) writes:
  16. |> : : cschang@hamlet.umd.edu (C. S. Chang) writes:
  17. |> : : : Is there any way to turn the PC speaker off so that there will be no
  18. |> : : : beeps if a certain function call failed.  I do not have access to this
  19. |> : : : particular function call which beeps at failure.  So I am looking for
  20. |> : : : a way to prevent the PC from generating some beeping noise.
  21. |> : : 
  22. |> : : Oh, you wanted a solution for PC-DOS? Well, also possible, cut the
  23. |> : : wire (this is no joke - it's the only way under PC-DOS).
  24. |> : 
  25. |> : Well, yes, this is the only way to do it for programs which control
  26. |> : the sound chip directly and / or write to the speaker port. But if you
  27. |> : are interested in cutting out plain vanilla beeps from plain vanilla
  28. |> : apps (which are likely to be using a dos / bios call to write ASCII 7 for
  29. |> : beep) then you *can* intercept the bios video interrupt and disable the
  30. |> : beep.
  31. |> 
  32. |> Normally (all the user's in our office) someone want's to turn off
  33. |> the speaker to play games. Most games have a turn-speaker-off-feature
  34. |> (and some a boss-is-coming-hotkey) today. But ALL games directly
  35. |> write to the speaker port.
  36. |> 
  37. |> Just interested - let us know for what reason do you need this feature,
  38. |> Mr./Mrs. Chang?
  39. |> 
  40. |> 
  41. |> Until later, Jan
  42. |> 
  43. |> -- 
  44. |> # Any language keeps its own misunderstandings; #
  45. |> # why shouldn't programming languages do?       #
  46. |> #                                               #
  47. |> #            wieck@jwminhh.hanse.de (Jan Wieck) #
  48.  
  49. It's practically impossible to turn off the speaker. But you can write
  50. a TSR program which will intercept the clock interrupt and repeatedly
  51. send CLOSE commands to the port register controlling the speaker. 
  52. Sometimes this can make the game completely silent. And in the worst
  53. case, it will reduce continuous, loud sound into intermittent, weak
  54. sounds.
  55.  
  56. A potential problem with this solution is that the game might also 
  57. provide its own clock interrupt handler, and if it decides not to
  58. keep the original ISR active (i.e., maintain an interrupt handler chain),
  59. all you have done might be in vain.
  60.  
  61. If you want to know more about the details, let me know.
  62.  
  63.  
  64. Shuang
  65.