VoiceRecorder: block incomplete recording / authorization page

PennController for IBEX Forums Support VoiceRecorder: block incomplete recording / authorization page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #4986

    Hi Jeremy,

    I have two questions on the VoiceRecorder element:

    1. How to deal with the situation where the subjects enter into the next trial before having recorded their response? There are two things that may happen with regard to this issue: subjects may click the “go to next page” button (1) without having started the voice recording; (2) without having ended the voice recording (that is, they forget to click the red voice-recording button twice). Both of these two situations will lead to the failure of collecting audio samples. Since this is a problem that almost all the audio recording trials need to deal with, is there any function or standard format of code that I can use?
    2. Customization of the authorization page. When the VoiceRecorder element is initiated, there’s a consent form presented to subjects, where they need to click on a link to authorize the experiment to use their recording device. But since the experiment I’m setting up is not for English speakers, is it possible to customize this page with the translation to other languages?

    Many thanks in advance!



    1. If you look at the documentation page for the VoiceRecorder element, you’ll see that there are two relevant commands: a wait command and a test.recorded command. I would favor the first one, using it like this:


    Alternatively, you could use getVoiceRecorder("sample").test.recorded() in your button’s wait command to validate the click only if a recording is present.

    2. You can partially customize the text by passing a string as the second parameter of InitiateRecorder. I should add an option to customize the consent text too, but in the meantime you can add this to your script:

    let replaceConsentMic = ()=>{
            let consentLink = $(".PennController-PennController a.Message-continue-link");
            if (consentLink.length > 0 && consentLink[0].innerHTML.match(/^By clicking this link I understand that I grant this experiment's script access to my recording device/))
                consentLink.html("En cliquant sur ce lien je comprends que j'autorise le script de cette expérience à accéder à mon microphone...");
                window.requestAnimationFrame( replaceConsentMic );
    window.requestAnimationFrame( replaceConsentMic );

    Of course you want to replace the French text with your own text.

    Let me know if you have questions


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.