home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / compiler / sample15.bas < prev    next >
BASIC Source File  |  1993-11-14  |  781b  |  46 lines

  1.  
  2.  
  3.         REM
  4.         REM DEMONSTRATION OF PLAYING A WAVE FILE OVER WINDOWS SOUND
  5.         REM SYSTEM OR SOUNDBLASTER UNDER DOS
  6.         REM
  7.  
  8.         a=mouseon
  9.  
  10.         REM
  11.         REM See if sound device present
  12.         REM
  13.  
  14.             a=snddev(0)
  15.  
  16.             if a=0 then
  17.  
  18.               Messagebox "Sound system not present","Sound warning",64
  19.  
  20.             else
  21.  
  22.               a$="wav"+chr$(0)+"*.wav"+chr$(0)+chr$(0)
  23.               openfileread a$,"","","Play a Wave File"
  24.  
  25.               if dialog$(102)="1" then
  26.                 ffname$=dialog$(100)
  27.                 seterrlevel 5
  28.                 playsound ffname$,1
  29.                 seterrlevel 7
  30.               end if
  31.  
  32.             end if
  33.  
  34.  
  35. print "Sound now playing..."
  36. input z
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.