﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 3  » How to play a sound file by pressing on a picture</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 20 Sep 2026 08:29:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5690.aspx</link><description>&lt;p&gt;Yep, my bad. I picked the wrong property.&lt;/p&gt;</description><pubDate>Mon, 28 Feb 2011 00:00:06 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5688.aspx</link><description>&lt;p&gt;Ah, I figured it out!&amp;nbsp; sound.mysound.selectedvalue did the trick.&amp;nbsp; Thanks for getting me in the right direction, I can rest easy now.&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 22:17:54 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5686.aspx</link><description>&lt;p&gt;I'd rather fix the problem using Inquisit's data output than using SPSS's syntax.&amp;nbsp; I have no experience with programming, but at least I have been using Inquisit for a few weeks now.&lt;/p&gt;
&lt;p&gt;I apologize for my denseness, but I can't figure out a way to do this by changing Inquisit's data output.&amp;nbsp; I believe you that it's possible, I just don't know how to do it.&amp;nbsp; Looking at the documentation (data and columns help sections in Inquisit) you pointed me to and trying a few different methods hasn't worked.&amp;nbsp; In your most recent post, I tried entering sounds.(mysound).stimulusitem, but it gave me an error message and didn't output anything.&lt;/p&gt;

&lt;p&gt;Edit:&amp;nbsp; I see you edited that post and replaced stimulusitem with selectedindex.&amp;nbsp; I now get a column of 1's, but I imagine there must be a way to change that?&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 15:21:20 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5685.aspx</link><description>&lt;p&gt;You must either customize Inquisit's raw data output (which is why I referred you to those documentation topics)&lt;br /&gt;&lt;br /&gt;&amp;lt;data&amp;gt;&lt;br /&gt;/ columns = [..., sound.mysound.selectedindex, ...]&lt;br /&gt;[...]&lt;br /&gt;&amp;lt;/data&amp;gt;&lt;br /&gt;&lt;br /&gt;or restructure your data in SPSS, preferrably using SPSS syntax (which isn't hard either).&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;~Dave&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 13:46:19 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5684.aspx</link><description>&lt;p&gt;Hmmm...Thanks for pointing me to that, but I'm still very puzzled.&amp;nbsp; I enter stimulusnumber as a column, and that spits out the info that I need, but &lt;i&gt;not &lt;/i&gt;in the spot I need it to enter into SPSS.&amp;nbsp; It would be easy enough to just copy paste that column one cell downward, but the problem I run into is this:&lt;/p&gt;

&lt;p&gt;The first trial they listen to the audio sample.&amp;nbsp; Then they are asked 2 questions about the trial.&amp;nbsp; So there is only one row that contains the stimulusnumber that I need to match responses to.&amp;nbsp; Meanwhile, I have 2 rows with responses.&amp;nbsp; See the attached image, where the two values of "3" are the responses to the stimulus.&amp;nbsp; What would be the best way for me to get those to line up? &lt;a href="/community/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/12/6076.spss.jpg"&gt;&lt;img src="/community/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/12/6076.spss.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 12:32:00 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5683.aspx</link><description>&lt;p&gt;Yes. Please see the documentation for the &amp;lt;data&amp;gt; element and the /columns attribute.&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 11:34:08 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5680.aspx</link><description>&lt;p&gt;I have a big problem that I didn't account for.&amp;nbsp; I'm scheduled to start running people in two days and didn't think of the fact that I need to have some way of pairing the number of stimulus (which audio sample they receive) to their responses to &lt;i&gt;that &lt;/i&gt;stimulus.&amp;nbsp; Currently all I can do is enter them by hand via the SPSS output, because the stimulus number and the response are not on the same line.&amp;nbsp; Is there a way to ask for the current stimulus number as one of the data outputs?&amp;nbsp; Then I would have that stimulus number in the same row as the response to the stimulus.&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description><pubDate>Sun, 27 Feb 2011 10:49:23 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5422.aspx</link><description>&lt;p&gt;Yay!!! After much tweaking, checking and double checking and editing, it looks like I've got it working how I want it.&amp;nbsp; Thanks a bunch!&lt;/p&gt;</description><pubDate>Sun, 06 Feb 2011 01:37:54 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5421.aspx</link><description>&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;defaults&amp;gt;&lt;br /&gt;/ inputdevice = mouse&lt;br /&gt;&amp;lt;/defaults&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ itemnumber = 0&lt;br /&gt;&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;counter mysounds&amp;gt;&lt;br /&gt;/ select = noreplace(1-6)&lt;br /&gt;&amp;lt;/counter&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text clicktoplaysound&amp;gt;&lt;br /&gt;/ items = ("Click me, hear sound.")&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text sound&amp;gt;&lt;br /&gt;/ items = sounditems&lt;br /&gt;/ select = values.itemnumber&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item sounditems&amp;gt;&lt;br /&gt;/ 1 = "01.wav"&lt;br /&gt;/ 2 = "02.wav"&lt;br /&gt;/ 3 = "03.wav"&lt;br /&gt;/ 4 = "04.wav" &lt;br /&gt;/ 5 = "05.wav"&lt;br /&gt;/ 6 = "06.wav"&lt;br /&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text nextsound&amp;gt;&lt;br /&gt;/ items = ("Next")&lt;br /&gt;/ position = (25%, 75%)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text repeatsound&amp;gt;&lt;br /&gt;/ items = ("Repeat")&lt;br /&gt;/ position = (75%, 75%)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial click&amp;gt;&lt;br /&gt;/ ontrialbegin = [values.itemnumber=counter.mysounds.selectedvalue]&lt;br /&gt;/ stimulusframes = [1=clicktoplaysound]&lt;br /&gt;/ validresponse = (clicktoplaysound)&lt;br /&gt;/ branch = [trial.play]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial play&amp;gt;&lt;br /&gt;/ stimulusframes = [1=sound, repeatsound, nextsound]&lt;br /&gt;/ validresponse = (repeatsound, nextsound)&lt;br /&gt;/ branch = [if(trial.play.response=="repeatsound")trial.play]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block myblock&amp;gt;&lt;br /&gt;/ trials = [1-6=click]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Sat, 05 Feb 2011 13:51:54 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5420.aspx</link><description>&lt;p&gt;I took a look at the correct script this time, and it's a mess.&amp;nbsp; Since his task is a paired comparison, there is a lot of extra stuff in there that I can't tell if it's related or not to what I need to do.&amp;nbsp; I assume the dummy trials are the things at the bottom?&amp;nbsp; I couldn't really figure out what was going on there either.&lt;/p&gt;</description><pubDate>Sat, 05 Feb 2011 13:24:19 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5418.aspx</link><description>&lt;p&gt;Well, you're looking at the wrong script. See "PairComp_Rev2.exp" attached to the last post on the previous page and re-read the posts related to that script. And no -- none of the lines are redundant.
&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Fri, 04 Feb 2011 03:00:44 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5417.aspx</link><description>&lt;p&gt;I've implemented the counter in my script and this now fixes the "repeat" problem.&amp;nbsp; Now when I press repeat it does play the same audio clip.&lt;/p&gt;
&lt;p&gt;The problem I have now is that the stimuli are not presented in random order:&amp;nbsp; I copied all of the same counter features that I thought were relevant in the plush script, and what I now get is:&lt;/p&gt;
&lt;p&gt;First trial plays the 2nd audio file, 2nd trial plays the 3rd audio file, 3rd trial plays the 4th and so on.&amp;nbsp; My guess is that it's because of the lines:&lt;/p&gt;

&lt;p&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ mastercounter = 1&lt;br /&gt;&amp;lt;/values&amp;gt; &lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;/ ontrialend = [values.mastercounter = values.mastercounter + 1]&lt;/p&gt;

&lt;p&gt;It seems to me that this script is not designed to play stimuli randomly.&amp;nbsp; Maybe I am misunderstanding some part of it?&lt;/p&gt;

&lt;p&gt;Also, I didn't understand why this "stop" line is included; seems redundant:&lt;/p&gt;
&lt;p&gt;./ trials = [1-90 = myturn1, myturn2, otherturn]&lt;br /&gt;/ stop = [values.mastercounter &amp;gt; 30]&lt;/p&gt;</description><pubDate>Fri, 04 Feb 2011 02:18:25 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5416.aspx</link><description>&lt;p&gt;Yeah I took a look but really couldn't make anything of it, partly because I wasn't sure if it was actually doing what I need my task to do.&amp;nbsp; I'll take a closer look and inspect it and let you know which things I get tripped up on.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</description><pubDate>Fri, 04 Feb 2011 01:27:20 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5415.aspx</link><description>&lt;p&gt;[quote](what are dummy trials?)[/quote]&lt;/p&gt;
&lt;p&gt;Dummy trials are &amp;lt;trial&amp;gt; elements that perform only helper functions like stimulus selection, scoring, etc. and are effectively invisible to subjects. Anyway, have you given the script I attached on the previous page a look? It does pretty much exactly what you're asking for.&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Fri, 04 Feb 2011 01:07:54 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic5414.aspx</link><description>&lt;p&gt;I think I'm asking for something similar as the others in this thread, but can't figure what's happening in the scripts that are posted (what are dummy trials?)&lt;/p&gt;

&lt;p&gt;I have several (~6) audio stimuli that I need to play, one stimulus per page.&amp;nbsp; I want participants to be able to repeat the sound, but so far, I haven't figured out a way to do that.&amp;nbsp; When I press repeat, it plays a new sound file.&amp;nbsp; I could do each trial separately, but the problem then is that the stimuli won't be presented in random order.&amp;nbsp; I've copy pasted the script:&lt;/p&gt;

&lt;p&gt;&amp;lt;trial sounddemo&amp;gt;&lt;br /&gt;/ stimulustimes = [0=soundcaption; 0=soundicon] &lt;br /&gt;/ validresponse = (soundicon, clicknext)&lt;br /&gt;/ responsetrial = (soundicon, soundicon)&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial soundicon&amp;gt;&lt;br /&gt;/ stimulustimes = [0=call,soundicon; 10000=clicknext, clickrepeat]&lt;br /&gt;/ validresponse = (soundicon, clicknext)&lt;br /&gt;/ responsetrial = (soundicon, soundicon)&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text soundcaption&amp;gt;&lt;br /&gt;/ items = ("Click the icon to listen to the sound.")&lt;br /&gt;/ size = (450,200)&lt;br /&gt;/ txcolor = (0, 0, 0)&lt;br /&gt;/ valign = bottom&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text clickrepeat&amp;gt;&lt;br /&gt;/ items = ("Click the icon to repeat")&lt;br /&gt;/ valign = bottom&lt;br /&gt;/ txcolor = (0, 0, 0)&lt;br /&gt;/ position = (50, 36)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;picture soundicon&amp;gt;&lt;br /&gt;/ items = ("soundicon.jpg")&lt;br /&gt;/ position = (50, 50)&lt;br /&gt;&amp;lt;/picture&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text clicknext&amp;gt;&lt;br /&gt;/ items = ("Click here to continue")&lt;br /&gt;/ txcolor = (0, 0, 0)&lt;br /&gt;/ position = (50, 67)&lt;br /&gt;/ fontstyle = ("Verdana", 14pt, true)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;sound call&amp;gt;&lt;br /&gt;/ items = audiosamples&lt;br /&gt;/ select = noreplace&lt;br /&gt;/ playthrough = true&lt;br /&gt;/ pan = 0&lt;br /&gt;&amp;lt;/sound&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item audiosamples&amp;gt;&lt;br /&gt;/1 = "M1.wav"&lt;br /&gt;/2 = "F1.wav"&lt;br /&gt;/3 = "AM1.wav"&lt;br /&gt;/4 = "AF1.wav"&lt;br /&gt;/5 = "AM2.wav"&lt;br /&gt;/6 = "M2.wav"&lt;br /&gt;&amp;lt;/item&amp;gt;&lt;/p&gt;</description><pubDate>Fri, 04 Feb 2011 00:56:29 GMT</pubDate><dc:creator>Inquisitive</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3499.aspx</link><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;after a little break I'm still/again working on the paired comparison script, pondering a new question:&lt;/p&gt;
&lt;p&gt;Is it somehow possible to combine one sound stimulus (activated by a button) and several likert ratings in one trial? I'm thinking of something like a surveypage with one sound button and several slider questions, but unfortunately the surveypage element does neither allow a responsemessage attribute (which is neccessary for playing back the sound) nor&amp;nbsp;branching to&amp;nbsp;dummy trials (which is neccessary for randomized stimulus selection).&lt;/p&gt;
&lt;p&gt;I guess I'll have to do it by using custom likert scales again? But in this case, I'd have to define countless picture items and randomization of the different questions within one trial would also be quite cumbersome...&lt;/p&gt;
&lt;p&gt;I'm grateful for every comment!&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Klemens&amp;nbsp;&lt;/p&gt;</description><pubDate>Mon, 02 Nov 2009 02:18:06 GMT</pubDate><dc:creator>Klemens</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3415.aspx</link><description>&lt;p&gt;[quote]Dave: You made my day![/quote]&lt;/p&gt;
&lt;p&gt;Thank you -- reading this makes my day!&lt;/p&gt;
&lt;p&gt;[quote]Now I see what you had in mind when talking about "dummy trials".[/quote]&lt;/p&gt;
&lt;p&gt;I use the term "dummy trials" for &amp;lt;trial&amp;gt; elements that solely perform supplemental tasks (item selection, imposing constraints, etc.). These trials usually don't require any subject interaction / responses and most of the time participants won't even know they exist. FYI, if you're familiar with E-Prime, trials set up like this essentially behave like "inline script".&lt;/p&gt;
&lt;p&gt;[quote]I also love the way you used the value items to only allow progression to the next stimulus selection trial when both sounds have finished playing![/quote]&lt;/p&gt;
&lt;p&gt;I just thought this would make sense. I'm glad you agree.&lt;/p&gt;
&lt;p&gt;Good luck with your research!&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Wed, 23 Sep 2009 01:24:45 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3414.aspx</link><description>&lt;p&gt;Dave: You made my day!&lt;/p&gt;
&lt;p&gt;Now I see what you had in mind when talking about "dummy trials". I also love the way you used the value items to only allow progression to the next stimulus selection trial when both sounds have finished playing!&lt;/p&gt;
&lt;p&gt;Thanks a lot, this did really help!&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Klemens&amp;nbsp;&lt;/p&gt;</description><pubDate>Wed, 23 Sep 2009 01:17:13 GMT</pubDate><dc:creator>Klemens</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3412.aspx</link><description>&lt;p&gt;This might work, but honestly doesn't strike me as a particularly efficient approach. Alas, you might want to check out the script attached to this reply first. I've tweaked your setup quite a bit. Item selection is done via a dummy trial as indicated earlier. And since you want participants to rate two sounds on their similarity, the script now only allows submitting a rating if the participant has actually listened to each sound at least once. Hope you can make something out of it...&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 09:41:40 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3411.aspx</link><description>&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;p&gt;I'm just thinking about splitting up the comparison trial and the stimulus selection "dummy" trial and place them in seperate blocks. In this way, I could set the selectionrate of the stimulus selection counter to "block". Then I'd be able to branch to a new block containing only the dummy trial after a rating has been given, whereas clicking on the buttons does not change blocks but only plays back the sound and afterwards repeats the comparison trial.&lt;/p&gt;
&lt;p&gt;Do you think this could work?&lt;/p&gt;
&lt;p&gt;Best, Klemens&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 08:25:21 GMT</pubDate><dc:creator>Klemens</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3410.aspx</link><description>&lt;p&gt;Hi Klemens,&lt;/p&gt;
&lt;p&gt;got the file and will take a look. Probably not gonna get to this today, but will post tomorrow.&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 06:14:40 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3409.aspx</link><description>&lt;p&gt;Hi Dave,&lt;/p&gt;

&lt;p&gt;I really appreciate your help. You can download the zip file from the link below:&lt;/p&gt;
&lt;p&gt;http://rapidshare.com/files/283436577/Paired_Comparison.zip.html&lt;/p&gt;

&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Klemens&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 05:17:56 GMT</pubDate><dc:creator>Klemens</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3406.aspx</link><description>&lt;p&gt;I'd be willing to invest a little time and look into this. However, I'd appreciate if you could put the script you pasted above as well as all supporting files (pictures, sounds) into a zip-file and either attach it to this thread (see the 'options' tab when replying) or upload it somewhere else. I'd like to have something to work with that will actually parse instead of throwing missing file errors on end...&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Tue, 22 Sep 2009 02:28:42 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3405.aspx</link><description>&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;thanks for your quick reply - this is a great forum!! I spent the last few days trying to figure out a way to link the approach you suggested with some advice from older post about paired comparisons (&lt;a href="/forums/Topic3064.aspx" target="_blank"&gt;http://www.millisecond.com/&lt;wbr /&gt;community/forums/t/1106.aspx&lt;/a&gt;,&amp;nbsp;&lt;a href="/forums/Topic2511.aspx#2511" target="_blank"&gt;&lt;wbr /&gt;http://www.millisecond.com/&lt;wbr /&gt;community/forums/p/976/2511.&lt;wbr /&gt;aspx&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I should have been more specific from the beginning: What I'd like to do is a paired comparisons-study with several auditory stimuli. In each comparison trial, the two sounds to be compared should only be triggered by user action (i.e. by clicking on one of two sound buttons, as opposed to clicking on the likert scale in order to give a rating).&lt;/p&gt;
&lt;p&gt;Here's what I've accomplished so far:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I've already set up the paired comparisons part using two linked counters that generate the randomized pairs.&lt;/li&gt;
&lt;li&gt;As you suggested, Dave, I've built my own likert scale and added the scale as well and two picture-buttons to my comparison trial.&lt;/li&gt;
&lt;li&gt;I tried to include some branching, so that the comparison trial is repeated when a button is clicked, whereas a dummy trial is started when a rating is given.&lt;/li&gt;
&lt;li&gt;Clicking on a button starts playback of the sound stim (via the "responsemessage"-attribute).&lt;/li&gt;
&lt;li&gt;In order to randomize within the stimulus pairs, I use counters to switch the position of the buttons.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;What I do not know yet is how to set up the dummy trial that selects new sound stimuli. Also, clicking the buttons starts playing the sound stims, but unfortunately starts a new trial at the same time (which is not a big surprise).&lt;/p&gt;
&lt;div&gt;&lt;ol&gt;&lt;/ol&gt;
&lt;p&gt;Here's my script:&lt;/p&gt;
&lt;p&gt;&amp;lt;sound sound1&amp;gt;&lt;br /&gt;/ items = sounds&lt;br /&gt;/ select = sound1select&lt;br /&gt;&amp;lt;/sound&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;sound sound2&amp;gt;&lt;br /&gt;/ items = sounds&lt;br /&gt;/ select = sound2select&lt;br /&gt;&amp;lt;/sound&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;item sounds&amp;gt;&lt;br /&gt;/1 = "stimulus1.wav"&lt;br /&gt;/2 = "stimulus2.wav"&lt;br /&gt;/3 = "stimulus3.wav"&lt;br /&gt;/4 = "stimulus4.wav"&amp;nbsp;&lt;br /&gt;&amp;lt;/item&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;counter sound1select&amp;gt;&lt;br /&gt;/ items = (&lt;br /&gt;1, 1, 1,&lt;br /&gt;2, 2,&lt;br /&gt;3)&lt;br /&gt;/ select = noreplace&amp;nbsp;&lt;br /&gt;&amp;lt;/counter&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;counter sound2select&amp;gt;&lt;br /&gt;/ items = (&lt;br /&gt;2, 3, 4,&lt;br /&gt;3, 4,&lt;br /&gt;4)&lt;br /&gt;/ select = current(sound1select)&amp;nbsp;&lt;br /&gt;&amp;lt;/counter&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;picture button1&amp;gt;&lt;br /&gt;/ items = ("button1.jpg")&lt;br /&gt;/ position = (counter.bswitch1.selectedvalue, 35%)&lt;br /&gt;/ erase = true(255, 255, 255)&lt;br /&gt;&amp;lt;/picture&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;picture button2&amp;gt;&lt;br /&gt;/ items = ("button2.jpg")&lt;br /&gt;/ position = (counter.bswitch2.selectedvalue, 35%)&lt;br /&gt;/ erase = true(255, 255, 255)&lt;br /&gt;&amp;lt;/picture&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;counter bswitch1&amp;gt;&lt;br /&gt;/ items = (40, 60)&lt;br /&gt;/ select = noreplace&lt;br /&gt;/ selectionrate = always&lt;br /&gt;&amp;lt;/counter&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;counter bswitch2&amp;gt;&lt;br /&gt;/ items = (60, 40)&lt;br /&gt;/ select = current(bswitch1)&lt;br /&gt;&amp;lt;/counter&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;trial comparison&amp;gt;&lt;br /&gt;/ stimulusframes = [1=button1, button2, likertscale, b1, b2, b3, b4, b5, b6, b7]&lt;br /&gt;/ inputdevice = mouse&lt;br /&gt;/ validresponse = (button1, button2, b1, b2, b3, b4, b5, b6, b7)&lt;br /&gt;/ responsemessage = (button1, sound1, 0)&lt;br /&gt;/ responsemessage = (button2, sound2, 0)&lt;br /&gt;/ responseinterrupt = trial&lt;br /&gt;/ branch = [if (trial.comparison.response == button1|| trial.comparison.response == button2) trial.comparison]&lt;br /&gt;/ branch = [if (trial.comparison.response == b1 &amp;nbsp;|| trial.comparison.response == b2 &amp;nbsp;|| trial.comparison.response == b3 &amp;nbsp;|| trial.comparison.response == b4 &amp;nbsp;|| trial.comparison.response == b5 &amp;nbsp;|| trial.comparison.response == b6 &amp;nbsp;|| trial.comparison.response == b7) trial.itemselection]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;trial itemselection&amp;gt;&lt;br /&gt;???&lt;br /&gt;/ branch = [trial.comparison]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;block allcomparisons&amp;gt;&lt;br /&gt;/ trials = [1-6= noreplace(comparison)]&lt;br /&gt;&amp;lt;/block&amp;gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Thanks a lot for your help for which I'm very, very grateful,&lt;/p&gt;
&lt;p&gt;Klemens&lt;/p&gt;
</description><pubDate>Tue, 22 Sep 2009 02:20:31 GMT</pubDate><dc:creator>Klemens</dc:creator></item><item><title>RE: How to play a sound file by pressing on a picture</title><link>https://forums.millisecond.com/Topic3386.aspx</link><description>&lt;p&gt;[quote]As I understood from your post, Dave, this would require to "nest" trials within trials, which is not possible in Inquisit at this time - or is it?[/quote]&lt;/p&gt;
&lt;p&gt;I don't see why one would need to "nest" trials in this case.&lt;/p&gt;
&lt;p&gt;[quote]I stumbled across the same problem as Plush did. I'd like to be able to play back a soundfile repeatedly by clicking on a button / picture. To further complicate things, there should be a likert element on the same frame.[/quote]&lt;/p&gt;
&lt;p&gt;Here's what you need to do:&lt;/p&gt;
&lt;p&gt;(1) Don't (!) use Inquisit's &amp;lt;likert&amp;gt; element in this case. Instead build your own likert scale as exemplified by this sample script: &lt;a href="/download/samples/v2/CustomLikert/customlikert.zip"&gt;http://www.millisecond.com/download/samples/v2/CustomLikert/customlikert.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(2) Add your sound stim and the button as an additional stimulus / response to the custom likert &amp;lt;trial&amp;gt;.&lt;/p&gt;
&lt;p&gt;(3) Apply branching logic to the &amp;lt;trial&amp;gt;: If subject clicks on button, repeat the trial. If subject submits a rating, move on to the next trial.&lt;/p&gt;
&lt;p&gt;(4) Be careful about item selection. In case of a button press you need to avoid selecting a new sound stim (in case you have several). Use dummy trials to do the item selection.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Fri, 18 Sep 2009 03:11:39 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>