Socket
Book a DemoInstallSign in
Socket

@jspsych-contrib/plugin-audio-swipe-response

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jspsych-contrib/plugin-audio-swipe-response

This plugin collects responses to an audio file using swipe gestures and keyboard responses.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
0
Created
Source

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 participant responds, when the audio file has finished playing, or if the participant 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@2.0.0"></script>

Compatibility

jsPsych v8.0. For compatibility with jsPsych v7.0, use version 1.0.0 of this plugin.

Documentation

See documentation

Author / Citation

Created by Adam Richie-Halford

Citation:

Pending

FAQs

Package last updated on 06 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts