Millisecond Forums

Hover over for sound, click to select

https://forums.millisecond.com/Topic35478.aspx

By ximenamorenoy - 6/23/2023

Hello everyone,

I am designing a task in which I show a few pictures of a sound icon at a time. In each trial, they have to listen to different audios (one for each of the icons), and then select one of those icons.

I already know how to click an image for sound, but I need them to listen to all the audios in the screen (at most 7 per trial) and then select one of them by clicking.
Participants should be able to listen to the audio only once.

Any thoughts on how to code this???

Crying Cat | Know Your Meme
By Dave - 6/23/2023

ximenamorenoy - 6/23/2023
Hello everyone,

I am designing a task in which I show a few pictures of a sound icon at a time. In each trial, they have to listen to different audios (one for each of the icons), and then select one of those icons.

I already know how to click an image for sound, but I need them to listen to all the audios in the screen (at most 7 per trial) and then select one of them by clicking.
Participants should be able to listen to the audio only once.

Any thoughts on how to code this???

Crying Cat | Know Your Meme

Things like this have been discussed before, e.g. here: https://forums.millisecond.com/Topic34252.aspx
By Dave - 6/23/2023

Dave - 6/23/2023
ximenamorenoy - 6/23/2023
Hello everyone,

I am designing a task in which I show a few pictures of a sound icon at a time. In each trial, they have to listen to different audios (one for each of the icons), and then select one of those icons.

I already know how to click an image for sound, but I need them to listen to all the audios in the screen (at most 7 per trial) and then select one of them by clicking.
Participants should be able to listen to the audio only once.

Any thoughts on how to code this???

Crying Cat | Know Your Meme

Things like this have been discussed before, e.g. here: https://forums.millisecond.com/Topic34252.aspx

And here's a simple example based off the linked thread, doing the same thing with hover-overs:

<block example>
/ onblockbegin = [
  list.responses.reset();
]
/ trials = [1=hovertrial]
</block>

<list responses>
</list>

<trial hovertrial>
/ ontrialend = [
    list.responses.appenditem(trial.hovertrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouseover
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.hovertrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
/ recorddata = false
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.hovertrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.hovertrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.hovertrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ inputdevice = mouse
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.hovertrial;
    } else {
        return trial.clicktrial;
    }
]
/ recorddata = false
</trial>

<trial clicktrial>
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
/ erase = false
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
/ erase = false
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
/ erase = false
</text>

<text asound>
/ items = ("Imagine sound A playing...")
/ position = (50%, 30%)
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
/ position = (50%, 30%)
</text>

<text csound>
/ items = ("Imagine sound C playing...")
/ position = (50%, 30%)
</text>
By ximenamorenoy - 6/24/2023

Dave - 6/23/2023
Dave - 6/23/2023
ximenamorenoy - 6/23/2023
Hello everyone,

I am designing a task in which I show a few pictures of a sound icon at a time. In each trial, they have to listen to different audios (one for each of the icons), and then select one of those icons.

I already know how to click an image for sound, but I need them to listen to all the audios in the screen (at most 7 per trial) and then select one of them by clicking.
Participants should be able to listen to the audio only once.

Any thoughts on how to code this???

Crying Cat | Know Your Meme

Things like this have been discussed before, e.g. here: https://forums.millisecond.com/Topic34252.aspx

And here's a simple example based off the linked thread, doing the same thing with hover-overs:

<block example>
/ onblockbegin = [
  list.responses.reset();
]
/ trials = [1=hovertrial]
</block>

<list responses>
</list>

<trial hovertrial>
/ ontrialend = [
    list.responses.appenditem(trial.hovertrial.response)
]
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouseover
/ validresponse = (a, b, c)
/ isvalidresponse = [
    list.responses.indexof(trial.hovertrial.response) == -1;
]
/ branch = [
    return trial.soundtrial;
]
/ recorddata = false
</trial>

<trial soundtrial>
/ ontrialbegin = [
    trial.soundtrial.resetstimulusframes();
    if (trial.hovertrial.response == "a") {
        trial.soundtrial.insertstimulusframe(text.asound, 1);
    } else if (trial.hovertrial.response == "b") {
        trial.soundtrial.insertstimulusframe(text.bsound, 1);
    } else if (trial.hovertrial.response == "c") {
        trial.soundtrial.insertstimulusframe(text.csound, 1);
    };
]
/ inputdevice = mouse
/ trialduration = 2000
/ branch = [
    if (list.responses.itemcount < 3) {
        return trial.hovertrial;
    } else {
        return trial.clicktrial;
    }
]
/ recorddata = false
</trial>

<trial clicktrial>
/ stimulusframes = [1=a, b, c]
/ inputdevice = mouse
/ validresponse = (a, b, c)
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
/ erase = false
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
/ erase = false
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
/ erase = false
</text>

<text asound>
/ items = ("Imagine sound A playing...")
/ position = (50%, 30%)
</text>

<text bsound>
/ items = ("Imagine sound B playing...")
/ position = (50%, 30%)
</text>

<text csound>
/ items = ("Imagine sound C playing...")
/ position = (50%, 30%)
</text>

Thanks, it really helped! :)