Message-Id: <36CEA528.305000AC@cableol.co.uk> Date: Sat, 20 Feb 1999 12:06:00 +0000 From: Allens X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Fast reading of multiple keypresses in Allegro References: <8D53104ECD0CD211AF4000A0C9D60AE356734A AT probe-2 DOT acclaim-euro DOT net> <7akim8$1k6$1 AT news5 DOT svr DOT pol DOT co DOT uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Andrew Davidson wrote: > > Shawn Hargreaves wrote in message > news:8D53104ECD0CD211AF4000A0C9D60AE356734A AT probe-2 DOT acclaim-euro DOT net... > >Andrew Davidson writes: > >> I think I'm approaching this problem from the wrong angle. Rather > >> than play a sample through allegro's functions is there any way I > >> can simply flex or relax the speakers a single time? > > > >The SB does have a non-DMA mode where you can just write sample > >values to the DAC whenever you feel like it, but I don't think > >this will really do what you want (so what exactly do you want, > >anyway? It would be useful if you could describe your goal in > >a bit more detail :-) Modern soundcards are designed for playing > >streams of sample data at a constant rate, and I think you will > >have a lot of trouble coaxing them to emulate those old speaker > >effects. > > I'm actually after emulating the tv speaker connected to a Spectrum computer > which was activated using bit 4 of port 254. The speaker flexes if bit 4 is > a 1 and relaxes if bit 4 is a 0. I need to do this in real time to tie in > with the rest of the emulation. Unimportant but didn't the speccy have a piezo electric sounder. Or have I replaced the speaker with one at some time rather too many years ago... > > >If you want to generate a waveform on the fly, you can use the > >Allegro audio streaming functions, as demonstrated in ex28.c. > > Would this be capable of playing real time music and sound effects generated > by flexing/relaxing a speaker at differing frequencies? I'll have to have a > look at this. > > Andrew That is what basic sound is, making a speaker go up and down will create a sound. I'm not too hot on audio streaming, but couldn't you create a square wave wav file, (or use audio steaming to make the equivalent, as then you would not have to change the pitch of the wav file so would be easier.)and use this too make the sound effects. Peter Allen