API.addGlobal({audioObj: new Audio("./images/ScreamLady.mp3")});
{type:'custom', fn: function(){ global.audioObj.play() }}
{
input: [
define(['pipAPI', 'lodash'], function (APIconstructor, _) {
var API = new APIconstructor();
var global = API.addGlobal({ audioObj: new Audio('./images/ScreamLady.mp3') });
API.addSequence([ { layout: [{ media: 'Loading audio' }], input: [ { handle: 'loaded', on: function (inputObj, canvas, stream) {
var $listener = stream(); global.audioObj.addEventListener("canplaythrough", $listener); return $listener; } } ],
interactions: [ { conditions: [{ type: 'inputEquals', value: 'loaded' }], actions: [{ type: 'endTrial' }] } ]
}, { stimuli: [ { handle: 'fixation', media: '+' }, { handle: 'cue', media: 'cue' } ], interactions: [ { conditions: [{ type: 'begin' }], actions: [ { type: 'showStim', handle: 'fixation' }, { type: 'setInput', input: { handle: 'showMyStim', on: 'space', duration: 400 } } ] }, { conditions: [{ type: 'inputEquals', value: 'showMyStim' }], actions: [ { type: 'resetTimer' }, { type: 'hideStim', handle: 'fixation' }, { type: 'showStim', handle: 'cue' }, function () { global.audioObj.play(); } ] } ] } ]);
return API.script;});
--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/d5e58ea9-0d71-4beb-9091-920820228bb3%40googlegroups.com.