x


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?

more ▼

asked Mar 19 '10 at 05:45 PM

maveryck21 gravatar image

maveryck21
239 29 32 44

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..

Mar 19 '10 at 06:27 PM Lipis

If it's playing a over and over but not sounding like it's looping it's probably your audio clip.

Mar 19 '10 at 07:39 PM karl_
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

check the loop box in the audio source.

more ▼

answered Mar 20 '10 at 11:01 AM

devilkkw gravatar image

devilkkw
297 7 10 18

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jun 12 '10 at 05:51 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1027
x295

asked: Mar 19 '10 at 05:45 PM

Seen: 4237 times

Last Updated: Mar 19 '10 at 05:45 PM