diff --git a/docs/markdown_docs/core_library/jspsych-pluginAPI.md b/docs/markdown_docs/core_library/jspsych-pluginAPI.md index f9d9016a..4cc0396c 100644 --- a/docs/markdown_docs/core_library/jspsych-pluginAPI.md +++ b/docs/markdown_docs/core_library/jspsych-pluginAPI.md @@ -172,7 +172,7 @@ Gets an AudioBuffer that can be played with the WebAudio API or an Audio object var source = context.createBufferSource(); source.buffer = jsPsych.pluginAPI.getAudioBuffer(trial.stimulus); source.connect(context.destination); -startTime = context.currentTime + 0.1; +startTime = context.currentTime; source.start(startTime); ``` diff --git a/plugins/jspsych-audio-button-response.js b/plugins/jspsych-audio-button-response.js index cfd72d26..c27481a8 100644 --- a/plugins/jspsych-audio-button-response.js +++ b/plugins/jspsych-audio-button-response.js @@ -161,7 +161,7 @@ jsPsych.plugins["audio-button-response"] = (function() { // function to end trial when it is time function end_trial() { - + // stop the audio file if it is playing // remove end event listeners if they exist if(context !== null){ @@ -194,7 +194,7 @@ jsPsych.plugins["audio-button-response"] = (function() { // start audio if(context !== null){ - startTime = context.currentTime + 0.1; + startTime = context.currentTime; source.start(startTime); } else { audio.play(); diff --git a/plugins/jspsych-audio-keyboard-response.js b/plugins/jspsych-audio-keyboard-response.js index 784dbbec..106cefdd 100644 --- a/plugins/jspsych-audio-keyboard-response.js +++ b/plugins/jspsych-audio-keyboard-response.js @@ -142,7 +142,7 @@ jsPsych.plugins["audio-keyboard-response"] = (function() { // start audio if(context !== null){ - startTime = context.currentTime + 0.1; + startTime = context.currentTime; source.start(startTime); } else { audio.play(); diff --git a/plugins/jspsych-audio-slider-response.js b/plugins/jspsych-audio-slider-response.js index 2769a027..fa21351a 100644 --- a/plugins/jspsych-audio-slider-response.js +++ b/plugins/jspsych-audio-slider-response.js @@ -41,7 +41,7 @@ jsPsych.plugins['audio-slider-response'] = (function() { button_label: { type: jsPsych.plugins.parameterType.STRING, pretty_name: 'Button label', - default: undefined, + default: 'Continue', array: false, description: 'Label of the button to advance.' }, @@ -72,7 +72,7 @@ jsPsych.plugins['audio-slider-response'] = (function() { } } - plugin.trial = function(display_element, trial) { + plugin.trial = function(display_element, trial) { // setup stimulus var context = jsPsych.pluginAPI.audioContext(); @@ -97,8 +97,7 @@ jsPsych.plugins['audio-slider-response'] = (function() { } var html = '