- Home /
Playing Audio clip in loop
I need to play a sound while an elevator is moving between floors. The elevators is activated by a if condition if(elevatorheight < or > floorHeight). The sound is playing but is not looping. It seems that the sound is being played a lot of times.
What is the problem?
Do you have script or something to start playing the sound? Just include the snippet of your code when you are dealing with the Audio.. it will much easier to solve your issue..
If it's playing a over and over but not sounding like it's looping it's probably your audio clip.
Answer by Jessy · Jun 12, 2010 at 05:51 PM
You need to add another variable that tracks if you already made the audio Play(), and create another if statement. Otherwise, the clip starts playing again every frame.
Sorry man. Posted this in the wrong place. But let me explain anyway. I needed to loop a audio clip (use wav...not mp3). my clip runs at 100bpm...So all i did was change the bpm in the inspector and add the clip twice in the list also in the inspector. Perfect looping sound. Hope this helps someone
Your answer
Follow this Question
Related Questions
How to start/stop/loop different music tracks 0 Answers
Stop audio loop 1 Answer
Trigger audio loop on beat with PlayScheduled 1 Answer