Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!unido!rwthinf!rwthbs!hls From: hls@rwthbs.uucp (H.L. Stahl) Newsgroups: comp.lang.c Subject: Re: DIGITALIZED SOUND ON PC? Message-ID: <1990Nov26.073830.25114@rwthbs.uucp> Date: 26 Nov 90 07:38:30 GMT References: <11516@j.cc.purdue.edu> <7607@umd5.umd.edu> Reply-To: hls@rwthbs.UUCP (Hans-Ludwig Stahl) Organization: Lehrstuhl fuer Betriebssysteme, RWTH Aachen Lines: 28 In article <11516@j.cc.purdue.edu> zhou@brazil.psych.purdue.edu (Albert Zhou) writes: > > I want to output some digitalized sound signal to the speaker. The key- >point I figured out is to control the volume of the speaker. While you >can use "sound" to control frequency, Turbo does not provide direct access >to the speaker. I searched throughout my DOS manual and could not find >a interrupt for speaker. Does anybody have any clue on how to access speaker? It's quite as simple: #define PB 0x61 /* adress of port B */ #define CREG 0x43 /* adress of 8253 command register */ #define LATCH 0x42 /* adress of 8253 latch register */ outp(PB, inp(PB) | 3); /* start sound */ outp(CREG,0xB6); /* send 8253 command */ outp(LATCH, durn & 0xFF); /* LowByte of duration */ outp(LATCH, durn >> 8 ); /* HighByte of duration */ outp(PB, inp(PB) & 0xFC); /* end sound */ Hope this helps! | _ : Hans-Ludwig Stahl, Lehrstuhl fuer Betriebssysteme, RWTH Aachen |_|_`__ : Kopernikusstr. 16, D-5100 Aachen, ..49-(0)241-804374 | |__) : Domain: hls@informatik.rwth-aachen.de |__) : uucp: ...!{seismo,mcvax,uunet}!unido!rwthinf!hls