Playing audio a specific number of times

Hello

I would like to play an audio file a certain number of times, let's say 3, after a learner has clicked an object.

I can see how to loop it using the loop command but of course, it does not stop automatically.

However, although I have tried to play with variables (incrementing them etc. I cannot seem to be able to get the file to play more than once). Basically, I need to set a loop inside a mouse click so that if the condition is not met, the file is played AND the counting variable is incremented.

Is there a simple way of doing this (ie. not requiring javascript)? It somehow feels that there should be but I cannot get my head around the logic of it.

Thanks

undefined

Discussion (3)

Thanks Sergey (again :) ). Audacity is not an option as I need to be able to change things either programmatically or manually according to circumstances. I will check out the "done" event.

Cheers

A super-easy way would be to use Audacity or any other sound editor and just make a 3-loop soundclip ;)

In Lectora, I would do this:

On Button undefined Play Audiofile.mp3

On Audiofile undefined Add +1 to variable _Counter

On Audiofile undefined Play Audiofile.mp3 undefined 3

Also, I hear that "on done" doesn't fire in some situations, so test it. If it doesn't work, add a timeline event to the audio 0.5 sec before it ends, used in the same way as "on done" above.

Hello... just following up.

Sergey is right that OnDone does not always work. The way I fixed it was to modify the recording slightly and resave it as MP3 (actually using the Lectora editor) and that seemed to do the trick (at least this time). Hope that helps others.

Discussions have been disabled for this post