Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Repeating Audio Stimulus within the same trial

edited December 2017 in OpenSesame

Hello. I have a touchscreen-based task that presents an image stimulus with an audio stimulus. Participants need to tap on the correct image so that the word is properly matched with the image, then the next trial appears. I wanted to include an option so that the audio stimulus can be played again if the participant wanted to hear it a second time (or third or fourth etc.). I’ve been trying to find a way to figure this out, but it has a been a bit challenging. I basically want participants to have the option to press 'spacebar' in order to repeat the audio stimulus. Is there a way to do that?

I've tried including this in line script but then participants have to press spacebar to move to the next trial (the touch response won't be registered unless space was hit), so that didn't work. There may be a completely different way of doing this, but this is what I've tried..

kb = keyboard()
key,time = kb.get_key(keylist = ['space'], timeout = None)

if key == 'space':
    my_sampler = sampler("path" + str(var.stimulus_sound), volume = 1)
    my_sampler.play()

I have attached a simple experiment file (with image attachments, couldn't upload the recordings, but you could use any audio I suppose).

Any help would be appreciated.

Sadek

Comments

  • Hi Sadek,

    Collecting touch (=mouse) and keyboard input at the same time is possible, but it will require either some inline scripting, or coroutines.

    However, isn't it easier in your case to reserve part of the display so that participants can tap on it to play the sound again? And then you embed the sound and the touch response in a loop that breaks when the participant does not touch on the part of the display that corresponds to the replay button; that is, the break-if statement could be [response] != [replay_response], where replay_response is a variable that defines the replay response, if that makes sense.

    Like so:

    What do you think?

    Cheers,
    Sebastiaan

  • Hi Sebastiaan,

    Thanks for this suggestion, it looks like it could really work. I was thinking about how I would reserve a part of the display so participants can tap on to play the sound again, and I'm not sure how I would go about doing that. If I have the touch_response item to 2 X 2, then there would only be those four quadrant coordinates on the screen that will allow for a touch response to be made in. If I were to include a separate replay button, what would it consist of and how would I initialize it as a touch response icon that is separate from the four quadrants that are essentially one of the four responses the participant can make?

    Also, a completely different question. How did you create the python interface for the script in my first comment? I only knew how to paste it in, but the box and format is much clearer and nicer.

    I appreciate your help on all of this.

    Sadek

  • Hi Sadek,

    These interfaces are based on markdown. It makes it easy to write nicely structured text. For the code example in particular.

    you have to include three tildes ~ + a dot . and python. On the next line you begin writing your code, and when your finished. you add three more tildes. (or just look it up on wikipedia).

    Good luck,
    Edaurd

    Buy Me A Coffee

  • Hi Sadek,

    The next version of OpenSesame (3.2) has a new feature that does exactly what you need: You can give names to the elements of a sketchpad, and then use these element names as regions of interest in a mouse_response item. (So you don't really need a touch_response anymore.)

    See:

    My recommendation would be to download the prerelease of 3.2, and use this functionality, which will make life much easier. OpenSesame 3.2 is not tagged stable yet, but it's close enough for me to recommend it at this point.

    Cheers!
    Sebastiaan

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games