3 Commits

Author SHA1 Message Date
Etienne Gaudrain
a0eda84fd8 Update tools.js
Fixed bug in Array.linspace (tools.js).
2026-04-24 13:30:41 +02:00
Etienne Gaudrain
f13361932a Added German to sound level adjustment 2026-04-24 13:26:45 +02:00
Etienne Gaudrain
23ec2b02b9 Update README.md 2026-04-22 11:20:53 +02:00
2 changed files with 17 additions and 5 deletions

View File

@@ -11,8 +11,12 @@ We've implemented some generic methods for audio testing with jsPsych:
* A plugin to do alternative forced choice with sounds: [jspsych-audio-sequence-button-response](docs/jspsych-audio-sequence-button-response.md). * A plugin to do alternative forced choice with sounds: [jspsych-audio-sequence-button-response](docs/jspsych-audio-sequence-button-response.md).
* A plugin to do extend `audio-keyboard-response`: [jspsych-audio-keyboard-response-wait](docs/jspsych-audio-keyboard-response-wait.md). * A plugin to do extend `audio-keyboard-response`: [jspsych-audio-keyboard-response-wait](docs/jspsych-audio-keyboard-response-wait.md).
* A plugin to do extend `audio-keyboard-response`: [jspsych-audio-keyboard-response-clickable](plugins/jspsych-audio-keyboard-response-clickable.js).
* A plugin to display a Coordinate Response Measure interface: [jspsych-crm](docs/jspsych-crm.md). * A plugin to display a Coordinate Response Measure interface: [jspsych-crm](docs/jspsych-crm.md).
* A plugin to do display a loading spinner while waiting for a (possible async) function to complete: [jspsych-waitfor-function](docs/jspsych-waitfor-function.md). * A plugin to do display a loading spinner while waiting for a (possible async) function to complete: [jspsych-waitfor-function](docs/jspsych-waitfor-function.md).
* A plugin where html can be clickable: [jspsych-html-keyboard-response-clickable](plugins/jspsych-html-keyboard-response-clickable.js).
* A plugin where images can be clickable: [jspsych-image-keyboard-response-clickable](plugins/jspsych-image-keyboard-response-clickable.js).
* A plugin to deal with Safari's quirky behaviour: [jspsych-audio-safari-init](plugins/jspsych-audio-safari-init.js).
## Tools ## Tools

View File

@@ -5,6 +5,8 @@
* (only to check if the sound level adjustment has been done already). * (only to check if the sound level adjustment has been done already).
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
// Latest version at https://git.web.rug.nl/dBSPL/jspsych-plugins/src/branch/main/js/tools.js
function is_browser_compatible(){ function is_browser_compatible(){
// Add here everything that needs to be tested for browser compatibility // Add here everything that needs to be tested for browser compatibility
if( (new Audio()).canPlayType('audio/mp3') != 'probably' ) if( (new Audio()).canPlayType('audio/mp3') != 'probably' )
@@ -61,22 +63,28 @@ SLADi18n['title'] = {};
SLADi18n['title']['fr'] = "Réglage du volume"; SLADi18n['title']['fr'] = "Réglage du volume";
SLADi18n['title']['en'] = "Sound level adjustment"; SLADi18n['title']['en'] = "Sound level adjustment";
SLADi18n['title']['nl'] = "Geluidsvolume"; SLADi18n['title']['nl'] = "Geluidsvolume";
SLADi18n['title']['de'] = "Lautstärkeanpassung";
SLADi18n['intro'] = {}; SLADi18n['intro'] = {};
SLADi18n['intro']['fr'] = "Il est conseillé de completer cette expérience dans un <b>environnement calme</b>, et de préférence en utilisant un <b>casque de bonne qualité</b>. Ajustez le volume de votre ordinateur de façon à ce que le son soit présenté à un niveau confortable, et gardez le volume identique pendant toute la durée de l'expérience."; SLADi18n['intro']['fr'] = "Il est conseillé de completer cette expérience dans un <b>environnement calme</b>, et de préférence en utilisant un <b>casque de bonne qualité</b>. Ajustez le volume de votre ordinateur de façon à ce que le son soit présenté à un niveau confortable, et gardez le volume identique pendant toute la durée de l'expérience.";
SLADi18n['intro']['en'] = "You are kindly asked to perform this experiment in a <b>calm environment</b>, and preferably using <b>good quality headphones</b>. Adjust the sound level on your computer so that the sound plays at a comfortable level, and keep the volume the same during the whole experiment."; SLADi18n['intro']['en'] = "You are kindly asked to perform this experiment in a <b>calm environment</b>, and preferably using <b>good quality headphones</b>. Adjust the sound level on your computer so that the sound plays at a comfortable level, and keep the volume the same during the whole experiment.";
SLADi18n['intro']['nl'] = "U wordt vriendelijk verzocht om dit experiment in een <b>stille omgeving</b> uit te voeren en bij voorkeur een <b>koptelefoon van goede kwaliteit</b> te gebruiken. Pas het geluidsvolume op uw computer aan zodat het geluid op een comfortabel niveau wordt afgespeeld, en verander het geluidsniveau verder niet meer gedurende het experiment."; SLADi18n['intro']['nl'] = "U wordt vriendelijk verzocht om dit experiment in een <b>stille omgeving</b> uit te voeren en bij voorkeur een <b>koptelefoon van goede kwaliteit</b> te gebruiken. Pas het geluidsvolume op uw computer aan zodat het geluid op een comfortabel niveau wordt afgespeeld, en verander het geluidsniveau verder niet meer gedurende het experiment.";
SLADi18n['intro']['de'] = "Wir bitten Sie freundlich, dieses Experiment in einer ruhigen Umgebung und möglichst mit hochwertigen Kopfhörern durchzuführen. Stellen Sie die Lautstärke Ihres Computers so ein, dass der Klang in einer angenehmen Lautstärke wiedergegeben wird, und behalten Sie diese Einstellung während des gesamten Experiments bei.";
SLADi18n['loading'] = {}; SLADi18n['loading'] = {};
SLADi18n['loading']['fr'] = "Chargement..."; SLADi18n['loading']['fr'] = "Chargement...";
SLADi18n['loading']['en'] = "Loading..."; SLADi18n['loading']['en'] = "Loading...";
SLADi18n['loading']['nl'] = "Bezig met laden..."; SLADi18n['loading']['nl'] = "Bezig met laden...";
SLADi18n['when-ready'] = {}; SLADi18n['loading']['de'] = "Wird geladen...";
SLADi18n['when-ready']['fr'] = "Quand vous êtes prêt.e, cliquez sur \"Continuer\".";
SLADi18n['when-ready']['en'] = "When you are ready, click on \"Continue\".";
SLADi18n['when-ready']['nl'] = "Als u klaar bent, klik je op \"Doorgaan\".";
SLADi18n['continue'] = {}; SLADi18n['continue'] = {};
SLADi18n['continue']['fr'] = "Continuer"; SLADi18n['continue']['fr'] = "Continuer";
SLADi18n['continue']['en'] = "Continue"; SLADi18n['continue']['en'] = "Continue";
SLADi18n['continue']['nl'] = "Doorgaan"; SLADi18n['continue']['nl'] = "Doorgaan";
SLADi18n['continue']['de'] = "Weiter";
SLADi18n['when-ready'] = {};
SLADi18n['when-ready']['fr'] = `Quand vous êtes prêt.e, cliquez sur "${SLADi18n['continue']['fr']}".`;
SLADi18n['when-ready']['en'] = `When you are ready, click on "${SLADi18n['continue']['en']}".`;
SLADi18n['when-ready']['nl'] = `Als u klaar bent, klik je op "${SLADi18n['continue']['nl']}".`;
SLADi18n['when-ready']['de'] = `Um fortzufahren, klicken Sie bitte auf "${SLADi18n['continue']['de']}".`;
function _make_sound_level_adjustment(sound_file, after_cb) function _make_sound_level_adjustment(sound_file, after_cb)
{ {
@@ -354,7 +362,7 @@ if(!Array.range) {
if(!Array.linspace) { if(!Array.linspace) {
Array.linspace = function(start, end, n){ Array.linspace = function(start, end, n){
var a = []; var a = [];
var step = (end-start)/n; var step = (end-start)/(n-1);
for(var i=0; i<n; i++){ for(var i=0; i<n; i++){
a.push(start+step*i); a.push(start+step*i);
} }