In the _ramp subroutine there is this code fragment.
`if you are going up a ramp
if oldht#+grav#0.0
repx#=newxvalue(cx#,newa#,newd#)
repz#=newzvalue(cz#,newa#,newd#)
position camera repx#,cy#,repz#
endif
I'd wager that this is a good place to check if the sound is playing or if you need to start it.
--
TAZ
Of course, that's just the tip of the iceberg. If that wav file is walking up creeky stairs, you might want to add an 'isMoving' flag so you don't play the sound if you stop on the stairs.
Now, if what you're after is environmental music, you probably should go with a waypoint list/array and check for proximity to those waypoints and play or stop the music appropriately. [Ah, I see that CR is explaining that method as well. Good deal.]