Tagged: audio recording
May 7, 2020 at 6:19 pm #5210
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??
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() )] ];May 7, 2020 at 8:59 pm #5211
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!May 7, 2020 at 9:09 pm #5212
and now it’s back to “saving” but the .mp3 doesn’t have anything in it 🙁May 7, 2020 at 9:14 pm #5213
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
JeremyMay 8, 2020 at 1:51 pm #5216
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.May 8, 2020 at 3:28 pm #5218
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.
JeremyMay 8, 2020 at 6:14 pm #5219
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!!May 8, 2020 at 8:09 pm #5220
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
JeremyMay 9, 2020 at 6:44 pm #5222
I have removed this but still no luck. Have others reported similar issues? Thank you!May 10, 2020 at 12:42 pm #5223
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
JeremyMay 11, 2020 at 4:16 pm #5225
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!May 11, 2020 at 6:09 pm #5226
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
JeremyMay 12, 2020 at 2:11 pm #5233
This works!! They did store as .ogg files. Thank you so much!!!!!
You must be logged in to reply to this topic.