Xref: utzoo comp.sys.amiga.programmer:1754 comp.sys.amiga.audio:425 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ames!vsi1!zorch!sega0!mykes From: mykes@sega0.SF-Bay.ORG (Mike Schwartz) Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.audio Subject: Re: playing samples using audio h/w Message-ID: Date: 25 Mar 91 03:54:25 GMT References: <2325@m1.cs.man.ac.uk> Organization: Amiga makes it possible Lines: 31 In article <2325@m1.cs.man.ac.uk> snowdond@r2.cs.man.ac.uk (D.N.Snowdon (MSc PJ)) writes: > > I'm having a problem playing sound samples by hitting the >hardware directly. The problem is that I set up the registers >for the channel I'm going to use and set audio DMA going > using > move.w #(DMAF_SETCLR!DMAF_MASTER!DMAF_AUD0),dmacon(a0) >as per the h/w manual. The sound starts playing OK. > If I then stop the sound by turning its DMA off using > move.w #DMAF_AUD0,dmacon(a0) again as in the h/w manual, >the sound stops. If I then reload the registers and start >DMA going the sound I get is the remains of the first sample >(assuming I stopped it before it had finished playing >completely). The h/w manual does say that if you stop and >start DMA over a short period then this can happen but there >is actually quite a long delay between turning off DMA for >the first sample and turning it on for the second. > Can anyone shed any light on this? > > Dave ( snowdond@uk.ac.man.cs ) When you want to stop a sound, what you need to do is to set the volume to 0, the period to 1, and turn off the DMA. Setting the period to 1 causes the rest of the current sample to be played VERY fast. You should also store a word to the AUDxDAT register to help it flush out. After a couple of scan lines worth of delay, you can start a new sound fine. -- ******************************************************* * Assembler Language separates the men from the boys. * *******************************************************