-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add headphone-check plugin #146
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! here are some quick initial thoughts
packages/plugin-headphone-check/examples/audio/antiphase_HC_IOS.wav
Outdated
Show resolved
Hide resolved
it("should load", async () => { | ||
const { expectFinished, getHTML, getData, displayElement, jsPsych } = await startTimeline([ | ||
{ | ||
type: jsPsychHeadphoneCheck, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a quick update here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a dummy test, but I can't for the life of me figure out how to mock the AudioPlayer
class...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mocked the AudioPlayer class in jspsych/jsPsych#3179 and some use cases are shown in the commits here jspsych/jsPsych@d296962
Also, perhaps it is worth looking into whether the audio files can be distributed via the cdn? |
🦋 Changeset detectedLatest commit: 31db640 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
at this point, it would be interesting to look into adding that functionality to the |
Wouldn't you still need the audio files themselves to be available? I think I'm missing something. |
I think we can add the audio files to the https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files |
my understanding of loading media in jsPsych is that you pass a file path in local memory to the trial- so i'm confused how passing in a link to the cdn that contains the file works in this case |
No, we're passing a URL. When experiments are hosted online the media files have to be hosted on a server, and so the audio file is loaded from the URL. One issue that we might run into is CORS requests. Loading media from remote URLs may cause issues. Worth investigating... |
hi all, this PR adds the headphone check plugin, a simple yet customizable way to check if a user is wearing headphones or not. this plugin attempts to recreate the functionality of the original HeadphoneCheck plugin described in the 2017 paper that speaks to its efficacy.
all functionality of the original package has been implemented in the style of jsPsych, with a simple boolean at the end to tell if the participant has passed the check or not. to view this plugin for yourself, be sure to do the usual:
cd
into theplugin-headphone-check
directory, runnpm i
andnpm run build
, and run the example in/examples/basic-configuration.html
. this'll recreate the original parameters as described in the original HeadphoneCheck plugin.any reviewers would be greatly appreciated, this is my first plugin after all ;^) but i had a blast making it and i can't wait to see how people will use this!