Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!ericom!eos.ericsson.se!epames From: epames@eos.ericsson.se (Michael Salmon) Newsgroups: comp.lang.c++ Subject: Re: ACCESS SPEAKER ON PC?? Message-ID: <1990Nov20.120229.10603@ericsson.se> Date: 20 Nov 90 12:02:29 GMT References: <11521@j.cc.purdue.edu> Sender: news@ericsson.se Reply-To: epames@eos.ericsson.se Organization: Ericsson Telecom AB Lines: 24 In article <11521@j.cc.purdue.edu> Albert Zhou writes: > > I got some digitalized sound data that I want to send to the internal >speaker of PC. Does anyone know of any DOS interrupt for controlling speaker? The simple answer is that there is none. The speaker is controlled by a combination of the timer and the parallel port. One channel of the timer is set to astable mode and is anded with one bit of the pp. One changes the tone by altering the divider (input = 1.2MHz) and turns it on or off with the pp. To make anything other than a monotone you must provide the speaker with a pulse width modulated bitstream. This can be achieved in 2 ways. i) use the pp and generate the bitstream in you programme. This is very hard and extremely unportable. ii) set the timer in monostable mode and vary the delay time. This also hard but portable. The timings mean that you can cope with 6 bit data. You also need a regular interupt to start each cycle and this can be done by taking over the clock interrupt. The concept is I think simple but the details are hard, particularly if you don't want to have to reboot your computer each time you run it. There are perhaps some PD programmes around but I don't know of any that come with source. Michael Salmon L.M.Ericsson Stockholm