April 2, 2017 at 2:11 pm #351830
In the absence of loop structures in Lectora, I have created an action group that calls itself a number of time to perform certain repetitive actions. One of these actions is to play a media file.
If I cannot attribute the media file name dynamically, then the solution would be to create as many action groups as there are audio files. This means duplicating the same group say 10 times but changing the name of the file inside the group. Duplication would just occupy a lot of space and, potentially, be confusing to non-programmers trying to write lessons in “pure” Lectora.
So… is there a simple non-JS -based solution for this difficulty?
Thanks for any help.
AndrewApril 2, 2017 at 9:49 pm #351864
Maybe its possible to use variables for that. If you can share a simple sample, we can try to use variables for the media file to be played…This post has received 1 vote up.April 3, 2017 at 12:07 am #351869
Thanks a lot as ever!
Attachments:April 3, 2017 at 1:03 am #351872
The sample attached is a step in the right direction. I do think its not a complete fix for your issues/question but for sure a step in a possible solution.
What i added:
– variable for the mediaToPlay -> default is 1, then after your first audio played 3x its set to 2
– extra actiongroup to add to the variable whenever needed.
Clicking the play button when your first audio has played 3x, well then the 2nd audio plays.
I/You/We/Us need to figure out whether that will work with 10 audios..and if not find a solution for that.
Another option i think is possible is just use the ‘Change Contents’ action on the audio file. It is available for audio files too, so should work. Might give that approach a try too.
MathThis post has received 1 vote up.
Attachments:April 3, 2017 at 1:14 am #351875
Thanks Math – will take a look a bit later as I have to go to work now.
I will report back
andrewApril 3, 2017 at 2:11 am #351877
Next version with 5 audios in it. Works as i thought it would. Slight changes needed on the previous one
– in the ag_updateMedia group:
– mediaToPlay incrementing the variable instead of setting it to a fixed num
– resetting Max_Reps to 0 to ensure when a audio has played 3 times, it can do the same with the next audio
Do replace audio3, 4 and 5 with your own shorter version… just picked 3 audio files i quickly found.. way too long for proper testing 😉
Minus i just noticed with my longer audios also is that due to the fact you loop Grp_LoopMedia01 after 5 secs..my newest audio ( 3,4,5 ) only play once, because they are longer then 5 seconds. Gonna think of a way to trigger the loop in another way…
Allthough this works swell, i am gonna try to dynamically change a variable and try ‘Change Content’ on audio…
So some alternatives available soon….
~MathThis post has received 1 vote up.
- This reply was modified 4 months, 2 weeks ago by Math Notermans.
Attachments:April 3, 2017 at 4:13 am #351884
I do think this version fits your needs nicely. Using ‘Change Content’ on a generic audiofile. So you have 1 audioplayer in your project and it gets filled by the next ones in line depending on variables. In fact i did use OnDonePlaying here, because that way also audios longer then that predefined 5 secs in your previous one get played 3x.
Lectora file in my opinion is nice and neat. Any decent developer should have no problem finding their way in this one. You need to make sure your audios end up in the media folder. I did by importing them to stage and then removing them…
~MathThis post has received 1 vote up.
Attachments:April 3, 2017 at 9:51 am #351937
I think that looks genial Math! I was not aware that you could change media files like that. It does mean that I can use OnDonePlaying which, of course, is much more precise than the delays I put in and less troublesome.
I will experiment a bit more and report back.
Thank you so much!This post has received 1 vote up.
You must be logged in to reply to this topic.