home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1990 / USERJL90.MSA / LISTINGS.ARC / SAMPLE.BAS < prev    next >
BASIC Source File  |  1990-05-16  |  1KB  |  43 lines

  1. REM Play a Digisound sample
  2. REM By R.A.Waddilove
  3. REM $OPTION Y+
  4.  
  5. LIBRARY "GEMAES","GEMDOS"
  6.  
  7. dummy%=FNform_alert%(1,"[3][Digital sounds created| with Digisound from  |    Alpha Systems][Wow!]")
  8. dummy%=FNform_alert%(1,"[3][Sounds played with portions|of software copyright Alpha|    Systems (c) 1987][Understood]")
  9.  
  10. DIM asm%(1500)        :' space for code
  11. DIM sdata%(20000)    :' space for sample
  12.  
  13. pgm& = VARPTR(asm%(0))
  14. BLOAD "basplay.exe",pgm&
  15. pgm& = pgm& + 28
  16.  
  17. DO
  18.     sample$ = FNfilename$        :'get sample filename
  19.     start& = VARPTR(sdata%(0))    :'get start of sample buffer
  20.     BLOAD sample$,start&        :'load sample data into buffer
  21.     POKEL pgm&+6,start&            :'set start of sample data
  22.     REM Length = size of sample file - 648 (envelope data)
  23.     POKEL pgm&+10,15000            :'set sample length (not very important)
  24.     REM Speed:  5k=7  8k=6  10k=5  16k=4  20k=3  25k=2  32k=1  40k=0
  25.     speed%=3 + FNform_alert%(2,"[3][select replay speed][16k|10k|8k]")
  26.     POKEL pgm&+14,speed%        :'set sample speed
  27.     CALL LOC pgm&                :'play sample
  28.     FOR i% = 0 TO 20000    STEP 4    :'clear sample buffer
  29.         POKEL start&+i%,0
  30.     NEXT
  31. LOOP UNTIL FNform_alert%(1,"[3][Another one?][Yes|No]") = 2
  32. SYSTEM
  33.  
  34. DEF FNfilename$
  35. path$ = CHR$(65+FNdgetdrv%) + ":\*.SND"
  36. ok% = 0
  37. fsel_input path$,name$,ok%
  38. WHILE right$(path$,1)<>"\"
  39.     path$ = LEFT$(path$,LEN(path$)-1)
  40. WEND
  41. FNfilename$ = path$+name$
  42. END DEF
  43.