Howdy, Stranger!

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

Supported by

Sampler object error (and other things)

Hello everyone,

I've recently created an experiment designed for OSweb, but I continue to get an audio error which is beyond my expertise to fix.

Essentially, I've set my Sampler object to continuously play a trial_audio.wav as a way for participants to test their sound volume for the actual experiment.

But even if it plays only once, I will sometimes get this disruptive error:

Here's the console error:

I'm uncertain whats going on, and would appreciate any help I could get. As well, I can attach the experiment here if need be.

Finally, I have one other little issue.

I have the participant give a keypress of 'Y' or 'N' to consent to the experiment. What's strange is that lowercase 'y' and 'n' work properly, as well as uppercase 'N'; however, uppercase 'Y' doesn't work even though I've instructed it to. Interestingly, uppercase 'Z' works in place of uppercase 'Y'.

I've had other keyboard issues such as the spacebar and the num-pad not working. If anyone has any insight into these problems, I'd love to hear them.

Regards, Rissa

Comments

  • Hi Rissa,

    > I have the participant give a keypress of 'Y' or 'N' to consent to the experiment. What's strange is that lowercase 'y' and 'n' work properly, as well as uppercase 'N'; however, uppercase 'Y' doesn't work even though I've instructed it to. Interestingly, uppercase 'Z' works in place of uppercase 'Y'.

    This sounds like a confusion between a QWERTY and QWERTZ keyboard layout. What is the layout of your keyboard? And do you experience this when running the experiment on the desktop or in a browser?

    We'll get back to you on the audio error.

    Cheers!

    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited May 29

    Hey Sebastiaan,

    Thanks for the quick reply!

    I realize I also made a mistake. It's not the capital 'Z' which works; it's the capital 'X'. But this may still be in reference to the QWERTY and QWERTZ keyboard layout issue.

    > This sounds like a confusion between a QWERTY and QWERTZ keyboard layout. What is the layout of your keyboard? And do you experience this when running the experiment on the desktop or in a browser?

    The keyboard is QWERTY, and I only experience the 'Y' and 'X' mix-up on the browser launch; the desktop version works fine. If OSWeb has a QWERTZ layout, is there any work-around for me?

    Again, thank you for the help, especially on the audio error!

    Regards, Rissa

  • Hi Rissa,

    would it be possible for you to attach your experiment here, so we can run it to try and reproduce your error?

    Best,

    Daniel

  • Hey Daniel,

    I've attached here just the practice block from our experiment for the sake of time and privacy. But the error occurs within the block, as well as with every other occurrence of the sampler object.

    There is a multi-character response required for the trial, so hopefully it functions properly.

    Thanks again for getting back to me on this issue. If you have any questions or need any more information, please ask.

    Regards,

    Rissa


  • Thanks Rissa, I hopefully have some time to look at this tomorrow.

    Thanked by 1lmelvill
  • Hi Rissa,

    I ran your experiment without major problems. There are some weird error messages on the console, but these errors don't appear to break anything as your experiment runs normally. Which version of osweb are you using? And did these errors occur in chrome (judging from your screenshots)?

    Could you try to run your experiment in http://osweb.cogsci.nl/ to see if it works. This now contains the latest version of osweb, in which your experiment ran fine for me.

  • I can reproduce it, but it's a bit unpredictable when it occurs.



    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Alright, that's a start. I went through the experiment 3 times and it didn't occur. Can you describe the steps to reproduce it, or does it happen intermittently?

  • It happens intermittently. I haven't found a clear pattern.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Alright, when I try to run it in Firefox I get the error right away. Chrome just works for me; do you experience the same regarding browser usage? At least I have something to go on now. Will get back about this soon.

  • edited June 14

    I do get a different error though, and I am using Pixi.js 4.8.8 (I updated it this morning):

    The sound however plays normally, and the experiment progresses without problems too.

    Regardless, this should be fixed, I only have no idea yet how... It seems that this error occurs at the level of Pixi.js which OpenSesame uses to play its sounds. I also don't know yet why the capybara demo experiment is nog plagued by this error...

  • Hey all,

    I just did some testing, and found similar results as before, even with OSWeb 1.3.1. It wouldn't be so much of a problem because the experiment continues fine, the variables are logged okay, and the sound plays. However, an error pop-up occurs intermittently upon sound playback, which is disruptive.

    I was using OSWeb 1.3.0 before, on a chrome browser. And, again, the pop-ups are disruptive.

    I tried the practice block a few times using the same specifications, and received this patterning of errors:

    I tested the practice_trial on Microsoft Edge in both OSWeb 1.3.0 and 1.3.1; both attempts were thwarted before the experiment even began. 1.3.0 gave me an application error, and 1.3.1 gets stuck on the loading screen.

    Finally, I tested in Internet Explorer, and either it was a blank screen in OSWeb 1.3.0, or it wouldn't load in 1.3.1.

    As a side, neither of the last two browsers are my main ones, so I am uncertain if there is something I am lacking which prevents a proper launch.

    I hope to hear from you guys soon. Thanks for all the help!

    Regards,

    Rissa

  • edited June 27

    Hi Rissa,

    I dived into this and there are two errors occurring here:

    The `osweb has stopped running due to a fatal error` message is caused by the `break_if` field in `text_lp_7`. In your practice_trial loop the `[response_t7]` field is initialized as empty. This causes the break_if field `[response_t7] = enter` to evaluate to ` == enter`, which is syntactically invalid javascript. This is not a mistake on your side, but on ours. Translating OpenSesame script and Python to Javascript remains a difficult feat... @sebastiaan how do you solve this in OpenSesame when a variable is empty? How do you make sure the stay valid Python statements? Since the experiment does not seem to suffer from this error and proceeds normally, I think we should give this a low priority for now, but keep it on our radar and think of an elegant fix. To remove the error message, I have changed all entries of `response_t7` in the practice loop to 0, and that did the trick.

    The second error, the annoying sampler one, was harder to tackle. I found out there were some fundamental things wrong with osweb's sampler implementation and did a major rewrite, that also made the codebase a lot leaner in the end, so that's a silver lining of the time this cost. The error should be fixed now, and I no longer experience any issues in any browser with your experiment. Could you check if it works for you too on http://osweb.cogsci.nl/ ? We will try to officially release this version of osweb soon if it works.

    Best,

    Daniel

  • edited June 28

    > how do you solve this in OpenSesame when a variable is empty? How do you make sure the stay valid Python statements?

    They are compiled to references to the var object. Also strings should be quoted. Looking at the syntax unit tests, OSWeb does the exact same thing though.


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Then I'm confused as to why this goes wrong. I'd also expect the whole experiment to crash and stop working if it were a syntax error to be honest...

  • Hey everyone,

    I just tested the experiment on Firefox, Chrome, and Internet Explorer. The first two worked absolutely perfectly! I experienced no sampler error messages at all!

    As for the scripting issue, filling the response with a character fixes it neatly. I see no problems there.

    Thank you so much, Daniel, for spending your time on this. It was a big ask, but you fixed the issue rather quickly. Now I can launch my experiment without worry.

    I really, really appreciate all the hard work.

    Regards,

    Rissa

  • Thanks Rissa,

    Never worry about Internet Explorer. Its market share is dwindling and close to zero nowadays, and many other applications stopped have already stopped developing for it completely in favor of MS Edge, because IE is ancient and increasingly difficult to support.

    Thanked by 1lmelvill
  • As a side, for experimenters who want to use a multicharacter (and numerical) text input for OSWeb, I've created a keyboard response using the inline_javascript object and other OS functions.

    I suppose this can work temporarily until the form objects are compatible with OSWeb. It's incredibly inefficient, but hey.

    I've set this one to 35 characters per input. I apologize for any sloppy coding.

    Regards,

    Rissa

    Thanked by 2Daniel sebastiaan
Sign In or Register to comment.