home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / childenc / oecdemo / shared.dir / 00393.ls < prev    next >
Encoding:
Text File  |  1996-07-24  |  1.8 KB  |  76 lines

  1. on playASoundFile sound1, subDir1, chan1, sound2, subDir2, chan2
  2.   global dontPlaySound, gMoviePathName
  3.   if stringp(chan1) = 0 then
  4.     if integerp(chan1) = 0 then
  5.       set chan1 to 1
  6.     end if
  7.   end if
  8.   if dontPlaySound = 1 then
  9.     exit
  10.   end if
  11.   set chan1 to value(chan1)
  12.   if string(chan2) <> EMPTY then
  13.     set chan2 to value(chan2)
  14.   end if
  15.   if string(chan2) <> EMPTY then
  16.     if chan1 = chan2 then
  17.       errMsg("Sound chanels must be different")
  18.       exit
  19.     else
  20.       if value(chan2) > 2 then
  21.         errMsg("Sound chanels must have values 1 or 2 only")
  22.         exit
  23.       end if
  24.     end if
  25.   end if
  26.   set Sound1FileName to getResPathName(sound1, "Media", subDir1)
  27.   put Sound1FileName
  28.   if the soundBusy of chan1 = 1 then
  29.     sound stop chan1
  30.   end if
  31.   PauseFor(10)
  32.   sound playFile chan1, Sound1FileName
  33.   if string(sound2) <> EMPTY then
  34.     set Sound2FileName to getResPathName(sound2, "Media", subDir2)
  35.     if the soundBusy of chan2 = 1 then
  36.       sound fadeOut chan2
  37.       sound stop chan2
  38.     end if
  39.     sound playFile chan2, Sound2FileName
  40.   end if
  41.   startTimer()
  42. end
  43.  
  44. on playOutSound chan
  45.   set theNullSound to the pathName & "Null Sound"
  46.   sound playFile chan, theNullSound
  47.   sound fadeOut chan, 30
  48. end
  49.  
  50. on stopSound chan, theDuration
  51.   if stringp(theDuration) = 0 then
  52.     set theDuration to 20
  53.   end if
  54.   if the soundBusy of chan = 1 then
  55.     sound fadeOut chan, value(theDuration)
  56.     sound stop chan
  57.   end if
  58. end
  59.  
  60. on PlayASoundFile2 sound1
  61.   global CR, errGlobal, dontPlaySound, soundStarted, platForm
  62.   if dontPlaySound = 1 then
  63.     exit
  64.   else
  65.     set soundStarted to "true"
  66.     set Sound1FileName to getResourcePathName(sound2, "Audio")
  67.     Xsound("play", Sound1FileName, "true")
  68.   end if
  69. end
  70.  
  71. on WaitForSound
  72.   repeat while Xsound("status") = "true"
  73.     nothing()
  74.   end repeat
  75. end
  76.