Change object state based on audio playtime?

Hello all,

I'm creating a survey tool that has audio playing for all the text, to assist low-literacy users.  The screens for the tool consist of a query and instructional sentence at the top, with responses below.  Yes and No buttons are provided for the user to give their input for each response, and the desire is that those buttons highlight to indicate which button is Yes, and which is No.

The highlighting should take place whenever the audio for the instructional sentence is played, which is at the beginning of the timeline, and whenever the repeat button is pressed.  The sentence is something along the lines of "Indicate if you [have had the issues shown on screen within the past 7 days], please select Yes or No for each".

I've checked the audio file in Audacity and have the start and end times for exactly when Yes and No are said.  For example, the audio says "Yes" from 6.63 seconds into the audio file, until 7.06 seconds.  I would like the Yes button to highlight during that time.  I have been able to make it work by using "Change state of object when timeline reaches..." triggers, but that only works on the first play through.

What I need your input on, is how to create a trigger on the Audio object for the sentence above, so that the Yes and No buttons highlight every time that audio is played (basically, when the repeat button is pressed).

 

Thanks in advance.

14 Replies
Brandon McGruder

Matthew/Ashley, I'm going to keep playing around with the idea to see if I can get it to work, but right now it's not working.

I'm going to be unavailable for the next few days, so I won't be able to work on this further until after that time.   I'll talk to you guys then, or start a new post, whichever is appropriate.

Thank you all again for your help.

Brandon McGruder

All,  I wanted to thank you one final time for your help and update you on the solution I found.

I wasn't able to find a solution by putting the audio on a separate layer; I think maybe there was some confusion about what I was trying to do.  My desire was to have two objects change state after audio had played for a certain duration of time, but wasn't complete.  The only trigger I found that allowed me to input an amount of seconds for the "When" criteria is the "When timeline reaches" trigger.  However, after the initial playing of the audio at timeline start, any additional plays of that audio (via the Repeat button I built) would not change the object states because it was no longer tied to the timeline.

The solution I found was to record 4 audio files, that were completely silent. The duration of the first audio file matched the time I desired the first object state change, the second audio file's duration matched the time I desired the first object to change back to it's original state, and the same for the third and fourth audio files and the second object. 

Then, I rigged an initial set of state changes for the two objects to happen when timeline reaches the desired number of seconds for the initial playthrough.  Next, I rigged the Repeat button to play not only the desired audio, but all four silent audio files simultaneously when pressed.  Finally, I set the state changes to occur "when media completes" for the four silent audio files, one after another, which gave me the repeatable, timed state changes that I desired.

Hope that was clear enough.  If it wasn't let me know, and I'll whip up a mockup slide that incorporates the logic.

Hope that helps someone else.  Cheers.

 

Brandon

moniek jansen

Hi Brandon, thanks for sharing your solution , it helped me a lot. Did you find a way to use a pausebutton and still being able to change the state at the right moment? I tried to but the audiofile don't restart at teh right moment, all together. 

I can't find were it going wrong. Can somebody help me? Se attached files. I tried it with different layers as wel, but nothing works right.

Brandon McGruder

Actually I appear to have been subscribed so I received the messages.

Moniek,

I completed the project I was using Storyline for some time ago, so I'm a bit rusty, but I dusted the ol' skills off and took a look.

After about 15 mins of meddling, I was able to add in a pause function that successfully paused the audio, and resumed play from the same spot.

However, I should mention now that I wasn't able to open your Storyline file because it was made in a newer version, so I don't know how you've constructed your slides and trigger logic.

The way mine works is as follows:

  • I created a boolean variable called IsMediaPlaying
  • When I start my slide, I have triggers that start playing my audio, and set IsMediaPlaying to "True"
  • To pause, I created a trigger to pause the audio when I doubleclick on a textbox in my slide, IF IsMediaPlaying is set to True, then set IsMediaPlaying to False because the audio is paused.  This trigger is attached to the textbox that the user double clicks on to pause.
  • To resume, I created a trigger that isn't attached to any object (it's in Slide Triggers at the top of the trigger list) that plays the media when the user clicks outside all the objects on my slide (when they click empty space), if IsMediaPlaying is False, which it is from when the audio was paused above

To be clear, the above solution is unpolished; the audio wouldn't pause again after resuming, but I was able to get the audio to resume, which you said was your issue.

I've included a screenshot of my triggers and the order they're in; the ones with the } on the side are what I added to make pausing work, the others were my original triggers.  Originally, this slide would play audio at start, and there's a repeat button (Picture 3 object in the trigger list), that only repeats if the audio isn't playing.

So if any of that helps you, great, if not, let me know and we'll dive in deeper.

 

Peace.