Playing back recorded audio

Hi,

I’ve created an online experiment with microphone recording, and I want to add a test at the beginning where the participant will record a few words and the recording will be played back to them so they can verify that their microphone is working well etc. (I want to avoid cases in which the participant does the entire experiment just for me to find out later that the sound wasn’t captures for some reason…).
Is there any way to do that? Can I play audio that was just captured?

Thanks!
Tal

Hello Tal,

I had a similiar problem and posted a request here.
See: Sound Feedback, playing back just recorded sound file

maybe it’s helpful :slight_smile: mind, however, we run the experiment offline, in a lab.
The key was to make psychopy save the audio file as soon as it had been recorded, which the code normally only does at the end.

Regards

Hi,

I made some progress on this, but couldn’t actually get the recording to play (in the online version)…
When I try to save “mic.getRecording()” or “mic.lastClip” (which should be an AudioClip object, if I understand correctly) into a variable and then feed it into a sound component on the next routine (either as is or with .play or .play()), I get one of these error messages each time:


I guess this means that the online version cannot play an AudioClip, but I am not sure what the alternative would be.

Another option would be to somehow use the recording after it is already saved into a file, but I am not sure how to access it during the same session.

Does anyone have any solution to this or any suggestion of what else I can try?

I am going to run many participants on this (it’s for a series of experiments), and I just don’t want to end up in a situation where I need to pay participants who complete the experiment without any usable recordings for some reason… I am not sure if this is a valid concern or if everything would go well without any mic test, but I feel like things can easily go wrong when recording is involved (i.e. a faulty microphone, failure to give mic access in the browser, etc.)

I would appreciate any help!
Thanks!
Tal

Lotti’s code works well locally, but doesn’t work online. We don’t know where the recording files go in the middle of a test. The recordings can only be downloaded after the test. I am also looking for an approach to reach out to the audio file recorded from microphone immediately after a trial.