psychopy.org | Reference | Downloads | Github

Pavlovia audio and resource errors

URL:
Identification: https://gitlab.pavlovia.org/chahlabenammar/identification
Rating task: https://gitlab.pavlovia.org/chahlabenammar/rating-task

Description of the problem:

Hello, so I’m trying to upload two auditory experiments online, one is an identification task with 4 test trials and 152 experimental trials, and the second is a rating task with 4 test trials and 80 experimental trials.

For the identification experiment, the trials work fine but once it moves on to the experimental part, it says that says:

Unfortunately we encountered an error:

*** when finding a player for the sound**

*** could not find an appropriate player.**

The rating task won’t work all together and when I run it, gives me this error:

Unfortunately we encountered the following error:

*** when downloading the resources for experiment: Rating Task**

*** unable to download resource: Stimuli/004_cab.wav (Decoding audio data failed.)**

Try to run the experiment again. If the error persists, contact the experiment designer.

Both experiments work just fine offline, I’m not sure how I can fix this.

Thanks!

It sounds like, despite being in .wav format, whatever kind of encoding you used is apparently not playing nice with the online audio system. What are the properties of these sound files? How were they made?

They were recorded as long files directly on PRAAT and then certain annotated tokens were extracted. It’s odd because the trials work but then everything after that doesn’t, so I’m not sure what the problem could be.
[/quote]

wav files aren’t supported by browsers. They’re an uncompressed format (large an quite innefficient for sending around the internet). You’ll need to convert your files to a compressed format. ogg files are an open (non-proprietary) format that works pretty much everywhere

@jon Others have reported getting .wav files working, I think: Sound stimulus-Unspecified JavaScript error

Is there a browser difference on this, or a size issue or something? Asking for general reference.

Ah, OK, on further inspection it turns out that most browsers to support wav files, but not Edge/Explorer: https://www.w3schools.com/html/html5_audio.asp
Apparently my recommendation for ogg was incorrect too, because Edge doesn’t support that either! MP3 is what I’d suggest then.

Online that might work, are we still restricted to libsndfile for running locally with Python? In that case we might be stuck with “sounds that will always work online don’t work locally and vice-versa” because libsndfile doesn’t like MP3. Not that there’s much to be done about it either way, just wanted to flag the possible issues…

Yes, sadly that looks true. I though ogg was the format that worked everywhere, but apparently not Edge or Safari :frowning:

Thank you!

I replaced the .wav with .mp3, and again, while it works for the trials, it gives me this error for the remaining trials for the rating experiment:

Unfortunately we encountered the following error:

*** when finding a player for the sound**
*** could not find an appropriate player.**

As for the identification experiment, it now gives me this error instead:

Unfortunately we encountered the following error:

  • when setting the image of ImageStim: image
  • when getting the value of resource: images/choices.jpg
  • unknown resource

Although I have it as being choices.png, not images/choices.jpg.


Your experiments aren’t publicly viewable at the moment, in the repository you’ll have to go to settings -> general -> permissions to allow us to see them (or me at least, @jon may have admin access but he’s busy). Make them public and I’ll try to have a quick look.

Oh, sorry, I didn’t notice that!


w/r/t the sound error, I think that’s because of sound_1 being defined as a note frequency rather than a file. PsychoJS doesn’t currently support sounds that aren’t sound files of some kind (i.e., defining a note and octave and all that doesn’t work) so you’ll need to replace that with a sound file.

W/r/t to the unknown resource error, I’m not entirely sure how that happened or why, but it’s looking for a folder that doesn’t exist. As a kludge fix, you could simply create the folder “images” in your repository and put the image file in it, but it looks like it shouldn’t be looking in a sub-folder at all, so I’m not sure where it’s getting that in the first place.