1.0.0 • Published 1 year ago

@jspsych-contrib/plugin-audio-swipe-response v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

audio-swipe-response

Overview

This plugin plays an audio file and records responses generated by both swipe gestures and keyboard response. This plugin will be useful for two-alternative forced choice (2AFC) assessments that will be administered on both desktop and mobile devices. The html prompt that accompanies the audio stimulus can be animated to move off-screen before the trial ends.

If the browser supports it, audio files are played using the WebAudio API. This allows for reasonably precise timing of the playback. The timing of responses generated is measured against the WebAudio specific clock, improving the measurement of response times. If the browser does not support the WebAudio API, then the audio file is played with HTML5 audio.

Audio files can be automatically preloaded by jsPsych using the preload plugin. However, if you are using timeline variables or another dynamic method to specify the audio stimulus, then you will need to manually preload the audio.

The trial can end when the subject responds, when the audio file has finished playing, or if the subject has failed to respond within a fixed length of time. You can also prevent a response from being recorded before the audio has finished playing.

Loading

<script src="https://unpkg.com/@jspsych-contrib/plugin-audio-swipe-response@1.0.0">

Compatibility

jsPsych v7.0

Documentation

See documentation

Author / Citation

Created by Adam Richie-Halford

Citation:

Pending