home *** CD-ROM | disk | FTP | other *** search
- on playASoundFile sound1, subDir1, chan1, sound2, subDir2, chan2
- global dontPlaySound, gMoviePathName
- if stringp(chan1) = 0 then
- if integerp(chan1) = 0 then
- set chan1 to 1
- end if
- end if
- if dontPlaySound = 1 then
- exit
- end if
- set chan1 to value(chan1)
- if string(chan2) <> EMPTY then
- set chan2 to value(chan2)
- end if
- if string(chan2) <> EMPTY then
- if chan1 = chan2 then
- errMsg("Sound chanels must be different")
- exit
- else
- if value(chan2) > 2 then
- errMsg("Sound chanels must have values 1 or 2 only")
- exit
- end if
- end if
- end if
- set Sound1FileName to getResPathName(sound1, "Media", subDir1)
- put Sound1FileName
- if the soundBusy of chan1 = 1 then
- sound stop chan1
- end if
- PauseFor(10)
- sound playFile chan1, Sound1FileName
- if string(sound2) <> EMPTY then
- set Sound2FileName to getResPathName(sound2, "Media", subDir2)
- if the soundBusy of chan2 = 1 then
- sound fadeOut chan2
- sound stop chan2
- end if
- sound playFile chan2, Sound2FileName
- end if
- startTimer()
- end
-
- on playOutSound chan
- set theNullSound to the pathName & "Null Sound"
- sound playFile chan, theNullSound
- sound fadeOut chan, 30
- end
-
- on stopSound chan, theDuration
- if stringp(theDuration) = 0 then
- set theDuration to 20
- end if
- if the soundBusy of chan = 1 then
- sound fadeOut chan, value(theDuration)
- sound stop chan
- end if
- end
-
- on PlayASoundFile2 sound1
- global CR, errGlobal, dontPlaySound, soundStarted, platForm
- if dontPlaySound = 1 then
- exit
- else
- set soundStarted to "true"
- set Sound1FileName to getResourcePathName(sound2, "Audio")
- Xsound("play", Sound1FileName, "true")
- end if
- end
-
- on WaitForSound
- repeat while Xsound("status") = "true"
- nothing()
- end repeat
- end
-