Play audio file while hovering over image with mouse


Author
Message
Julia
Julia
Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)
Group: Forum Members
Posts: 6, Visits: 17
Hello,
I have a question about the ability to present audio stimuli in Inquisit. I have a task in which the participant sees a someone making a facial expression and then, on the next page, has to choose one of 6 buttons (labeled with different emotions) to designate whether the person was happy, sad, angry, disgusted, etc. Basically, the idea is to test how well people can identify others' emotions.

The problem is that I'm trying to modify this task for use with 5 year old kids, and their reading abilities aren't quite there yet. Is it possible to have an audio file play while they hover over each emotion button with their mouse? For example, when the screen with buttons for them to click on pops up, could I pair an audio file with each button so that they can hear the word read aloud to them (e.g., they hover over the button "sad" and an audio file plays that says "sad")? I know I can pair an audio file with an image, but the tricky thing about this one is that there are 6 images on the screen and I need to have 6 different audio files to pair with them, and need them to only play when the mouse is hovering over the corresponding image. Any tips?

Thank you!!!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
jcla89 - Tuesday, September 5, 2017
Hello,
I have a question about the ability to present audio stimuli in Inquisit. I have a task in which the participant sees a someone making a facial expression and then, on the next page, has to choose one of 6 buttons (labeled with different emotions) to designate whether the person was happy, sad, angry, disgusted, etc. Basically, the idea is to test how well people can identify others' emotions.

The problem is that I'm trying to modify this task for use with 5 year old kids, and their reading abilities aren't quite there yet. Is it possible to have an audio file play while they hover over each emotion button with their mouse? For example, when the screen with buttons for them to click on pops up, could I pair an audio file with each button so that they can hear the word read aloud to them (e.g., they hover over the button "sad" and an audio file plays that says "sad")? I know I can pair an audio file with an image, but the tricky thing about this one is that there are 6 images on the screen and I need to have 6 different audio files to pair with them, and need them to only play when the mouse is hovering over the corresponding image. Any tips?

Thank you!!!

This is probably possible, but will require a fair amount of validation logic and branching to play back the corresponding audio file. A very basic example to illustrate what I mean would look like this:

// check over which response option the mouse hovers
<expressions>
/ ismouseoverhappy = (mouse.x > 0.05*display.width && mouse.x <  0.35*display.width && mouse.y > 0.35*display.height && mouse.y < 0.65*display.height) && trial.mouseovertrial.elapsedtime > 500
/ ismouseoversad = (mouse.x > 0.65*display.width && mouse.x <  0.95*display.width && mouse.y > 0.35*display.height && mouse.y < 0.65*display.height) && trial.mouseovertrial.elapsedtime > 500
</expressions>

<values>
/ itemnumber = 1
</values>

<block myblock>
/ trials = [1-4=starttrial]
</block>

<trial starttrial>
/ ontrialbegin = [
    values.itemnumber = list.itemnumbers.nextindex;
]
/ branch = [
    trial.mouseovertrial
]
/ trialduration = 0
</trial>

// display stimuli and accept responses
// if no click on an option has occurred and the mouse hovers over one of the options
// branch to a trial that plays audio corresponding to the response option
<trial mouseovertrial>
/ stimulusframes = [1=happy,sad,stimulus]
/ inputdevice = mouse
/ validresponse = (anyresponse)
/ isvalidresponse = [trial.mouseovertrial.response == "happy" || trial.mouseovertrial.response == "sad" || expressions.ismouseoverhappy || expressions.ismouseoversad]
/ branch = [if (trial.mouseovertrial.response != "happy" && trial.mouseovertrial.response != "sad" && expressions.ismouseoverhappy) trial.playhappy]
/ branch = [if (trial.mouseovertrial.response != "happy" && trial.mouseovertrial.response != "sad" && expressions.ismouseoversad) trial.playsad]
/ responsemessage = (happy, clearscreen, 1000)
/ responsemessage = (sad, clearscreen, 1000)
</trial>

// play back the sound corresponding to the "happy" response option
<trial playhappy>
/ stimulusframes = [1=happysound]
/ inputdevice = mouse
/ validresponse = (0)
/ trialduration = 10
/ branch = [trial.mouseovertrial]
/ recorddata = false
</trial>

// play back the sound corresponding to the "sad" response option
<trial playsad>
/ stimulusframes = [1=sadsound]
/ inputdevice = mouse
/ validresponse = (0)
/ trialduration = 10
/ branch = [trial.mouseovertrial]
/ recorddata = false
</trial>

<text happy>
/ items = ("happy")
/ txbgcolor = greenyellow
/ size = (30%,30%)
/ position = (20%,50%)
/ erase = false
</text>

<text sad>
/ items = ("sad")
/ txbgcolor = red
/ size = (30%,30%)
/ position = (80%,50%)
/ erase = false
</text>

<text stimulus>
/ items = ("happy face 1", "happy face 2", "sad face 1", "sad face 2")
/ select = values.itemnumber
/ position = (50%, 10%)
/ erase = false
</text>

<list itemnumbers>
/ poolsize = 4
</list>

<video happysound>
/ items = ("happy.mp3")
/ playthrough = true
</video>

<video sadsound>
/ items = ("sad.mp3")
/ playthrough = true
</video>

Hope this helps.

Julia
Julia
Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)
Group: Forum Members
Posts: 6, Visits: 17
Thank you so much, Dave! I'll give it a try! :)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search