Howdy, Stranger!

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

Supported by

[solved] variables in sampler

edited June 2015 in OpenSesame

Hi there,

I'm creating a task where subjects have to categorize sounds. Two variables are being manipulated for every sound: [stop] and [puff]. I have named the sound files in my file pool according to the values of these variables in the format [stop][puff].wav (eg. ta_65.wav), and I've edited the script for the sampler item to read: set sample "[stop][puff].wav" . I'm trying to get the sampler to pick a file from the file pool in each trial based on these variables, but opensesame gives me the following error message: Failed to load sample in sampler 'stimulus': sampler.init() the file '[stop]_[puff].wav' does not exist .

How do I fix this?

Thanks!
Naomi

Comments

  • edited 7:22PM

    Hi Naomi,

    Thank you for your interest in OpenSesame!

    This is a bug in previous versions of OpenSesame. What you can do is

    A) update to 0.25 (released today)

    B) Work around the bug, by inserting the following script in the prepare phase of an inline_script item at the start of the trial sequence:

    self.experiment.set("my_sound_file", self.get("stop")+"_"+self.get("puff")+".wav")

    This creates a new variable "my_sound_file", which can be used in the sampler as [my_sound_file]. (If you don't mix variables and regular text it works, despite the bug).

    Hope this helps!

    Regards,
    Sebastiaan

  • edited 7:22PM

    Thanks you Sebastiaan! I downloaded the new version and it worked like a charm.

  • joejoe
    edited 7:22PM

    I'm having this same problem, but I have version 0.26. Can you tell me why this is happening?

  • edited 7:22PM

    Hi Joe,

    Could you provide us with some more information? How are you using the sampler item? And where does it go wrong? What kind of error message do you get? Perhaps it would be easiest if you could upload your experimental script here by doing the following:

    • Open the "General properties" tab, click "Script editor" and copy the whole script,
    • go to http://pastbin.com or http://gist.github.com, upload your script there (simply paste and submit)
    • and provide us with the resulting link in your forum post.

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • joejoe
    edited October 2013

    Hi Lotje,

    I've uploaded my script. Here is the link: http://pastebin.com/QmfTQQKD

    What I'm trying to do is have 11 .wav files play at a random order. It is a mix of English "we" and French "oui" words and I have it set up so the participant will press 1 for English and 2 for French. Sometimes the error will happen from the beginning, other times it wont happen until after a few .wav files have played. I'm very new to open sesame so I'm not too saavy at this point.

    The error reads:

    Error: Runtime error
    Description: Failed to load sample in sampler '___sampler': openexp._sampler.legacy.__init__() the file '.wav' does not exist
    

    Thank you

  • edited 7:22PM

    Hi Joe,

    You set the number of cycles in your loop item to 12, although only 11 cycles contain a value for the variable 'sibilant_type'.

    image

    As a consequence, in cycle 12 the sampler item is looking for a file called " .wav" (instead of .e.g , "Female Speaker 1-stimulus001.wav"), which does not exist. This causes the error message.

    Thus, simply setting the number of cycles to 11 instead of 12 should solve the problem.

    Sometimes the error will happen from the beginning, other times it wont happen until after a few .wav files have played.

    This part can be explained by the fact that the order of the loop item is set to random.

    Does that make sense?

    Cheers,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 7:22PM

    Hello Sebastian, thank you for opensesame. Could you help me?
    I need to design an perception task and test how people discriminate two different sounds, and I try to get the sampler to pick two sound files in the pool at a time. I added two variables as [word1] and [word2]. I also try to get the subject hear the second sound file after 500ms. But the script like [word1] 500ms [word2] seemed wrong.

  • edited 7:22PM

    Hi Sophia,

    I suppose it might be better if you post your problem in a separate discussion, otherwise it's easily overlooked.

    Regarding your problem, in order to be able to help you, we need more information what you did exactly and what it is that goes wrong. So, you could post your code, and/or the error message. At any rate, more details are necessary, before I can help.

    Thanks,

    Eduard

    Buy Me A Coffee

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