Audio recording help

PennController for IBEX Forums Support Audio recording help

This topic contains 12 replies, has 2 voices, and was last updated by Avatar ktetzloff 2 weeks, 3 days ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #5210
    Avatar
    ktetzloff
    Participant

    I am trying to get a few trials with audio recording, but the rest of the experiment is programmed for the old ibex. It says it is recording, and files are created in my uploads folder like they should, but they are blank .mp3 files. The rest of the experiment is programmed in the style of the old Ibex farm, so I have these as items in the running order. Does anyone know why the .mp3 files don’t contain the recorded audio?? Or how can I combine the regular ibex trials with these PennIbex controllers??
    Thank you!!!

    PennController.ResetPrefix(null);
    var shuffleSequence = seq( // order of item presentation 
    "save", // tell where to save files 
    "s-s-verbal" // voice recording trial
    );
    
    var items = [  //list of items
    ["save", "PennController", PennController.InitiateRecorder("https://EDITED/EDITED.php")],
    ["s-s-verbal", "PennController", PennController(
       
      newText("instructions", "Write instructions here.")
            .print(),
        newVoiceRecorder("recorder")
            .record(),
        newTimer("recording", 5000) //5 seconds only right now.
            .start()
            .wait(),
        getVoiceRecorder("recorder")
            .stop(),
    
            newButton("send", "Click here to continue")
            .print()
            .wait()
    )]
    ];
    #5211
    Avatar
    ktetzloff
    Participant

    I was fiddling around, and now it gives me this error:

    [20:51:56] VoiceRecorder’s Ajax post failed. (0); (PennController: NA)

    Any suggestions? Thank you!

    #5212
    Avatar
    ktetzloff
    Participant

    and now it’s back to “saving” but the .mp3 doesn’t have anything in it 🙁

    #5213
    Jeremy
    Jeremy
    Keymaster

    Hi,

    The error you report in your second message seems inconsistent with your receiving any mp3 files at all in your uploads folder. If the Ajax post fails, then it never reaches your server, so however you got that error to show up, it’s probably not why you got blank mp3 files.

    What browser are you using? Safari (especially the iOS version, but some desktop versions too) is known to have bad to no support of audio capture.

    When you ask how you can combine the regular ibex trials with the PennController trials, what do you mean exactly? Judging from your code, it looks like it’s already what you are doing.

    NB: you should use .log() before .record() to make it easier to pair the files your receive on your server with the lines in your results file.

    NB bis: I edited the code in your first message to replace the URL to your php script—attacks are unlikely but it’s always safer not to expose a public way of uploading content to your servers

    Jeremy

    #5216
    Avatar
    ktetzloff
    Participant

    Thank you for the reply; I fixed the Ajax post error but am still only receiving blank audio files. I am using Dreamhost as a server and have the permissions set properly, but I wonder if this is part of the issue. Maybe I should use Linode or something else? I have tried using Chrome and Firefox, but the same thing happens.

    #5218
    Jeremy
    Jeremy
    Keymaster

    I doubt that the problem would be coming from your server, as its job is simply to receive the archive, it won’t filter its content (the mp3 files themselves). The problem most likely arises at the encoding level, on the participant’s end. Are you able to hear your recording by playing the replay button? Feel free to share the URL to your experiment with me so I can further investigate.

    Jeremy

    #5219
    Avatar
    ktetzloff
    Participant

    I am able to play back the sound when I test it.. Here is the url (just one page of voice recording, as I commented the rest out).
    Thank you!!

    https://expt.pcibex.net/ibexexps/ktetzloff/ktexp1/experiment.html

    #5220
    Jeremy
    Jeremy
    Keymaster

    I’m afraid you won’t be able to use both PennController’s voiceRecorder element and the other script that you uploaded (Recorder.js?) that also requests access to the microphone. Try deleting that other script and see what happens

    Jeremy

    #5222
    Avatar
    ktetzloff
    Participant

    I have removed this but still no luck. Have others reported similar issues? Thank you!

    #5223
    Jeremy
    Jeremy
    Keymaster

    Unfortunately I’m not aware of other people experiencing the same issue. Taken together, the facts that playback works just fine and that a ZIP file does get uploaded to the server are really puzzling: there’s no indication of a problem on the participant’s end nor on the server’s end…

    I just did a test run myself: can you check on your servers whether the mp3 file of my recording is also silent? You should hear 3 (rather unpleasant) whistles

    Jeremy

    #5225
    Avatar
    ktetzloff
    Participant

    No, it still didn’t work. I tried using a different computer, and I also tried a whole separate experiment just using the PCIbex syntax, and the same thing happens. 🙁 Thank you for your help though!

    #5226
    Jeremy
    Jeremy
    Keymaster

    I think I understood what is happening: the .mp3 files you collected are not blank, they just use a non-mpeg codec. It’s my fault: at the time I created the voiceRecorder element I was confused about audio-encoding specification and I thought that my code output proper MP3 files. But I just tested collecting recordings again today and when I look at the properties of the mp3 file from the uploaded archive, it says “Codec: Opus.” I’m sorry about that, my apologies for the inconvenience.

    If you still have those .mp3 files, here are a couple things you can try. First, try renaming them so they have a .ogg extension instead of .mp3. If that doesn’t work, it means that the software that you use to open audio files does not support the Opus codec. I suggest you download VLC media player, it has great codec support and it’s free and open source.
    If that works, then you can go ahead and collect audio recordings. Just remember to use .ogg/VLC.

    I will fix the encoding issue in the next release of PennController

    Jeremy

    #5233
    Avatar
    ktetzloff
    Participant

    This works!! They did store as .ogg files. Thank you so much!!!!!

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.