Variable volume in OSWeb sampler / file pool URL
Hi,
I'd like to have a loop at the beginning of an experiment where the participant can adjust the volume to their liking, then have this applied to all samples. My idea is to set an initial value for volume in vars, then the participant can adjust this up and down via keypresses, playing a test sound in between for feedback.
This volume value will then be applied to all subsequent samples.
I created an experiment with an inline_javascript containing only
vars.vol = 0.5;
in the Prepare tab and a sampler with an example WAV file and changed
set volume "[vol]"
in the script view.
This pops up an alert "TypeError: console.warning is not a function"
Going into the console and tracking down the error, the code for this is:
console.warning("Unable to apply volume or gain",t)
As a workaround I looked at adding an audio element to the page using inline_javascript, but got stuck on trying to find the URL for the sound file in the file pool. (That's not essential of course, it could be hosted elsewhere, but it would be nice to keep it with the rest of the experiment).
So, it would be great if anyone had any pointers for either:
- Variable volume on samplers in OSWeb (though maybe it's just not supported yet, which is fine of course!)
- How to get the URL for a file in the file pool, then I'll add an audio element using inline_javascript.
Thanks!
Comments
p.s. just checked and this does work with an external file URL for the sound using JS audio:
It would still be nice to use the file pool, though not essential of course!
Hi,
wrt to your first point, I don't see a reason why it shouldn't work/be implemented, so my guess would be this is a bug (at least I can confirm that the problem occurs). @sebastiaan what do you think?
Eduard
Hi @alisdt and @eduard ,
Sorry for the slow response—this fell off the radar for a bit. But indeed, there are two bugs here, and I just created an issue for them. Should be fixed in OSWeb 1.3.14, which should be included with OpenSesame 3.3.10!
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Many thanks @sebastiaan , good to know!