1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

BF: Handle when Sound.setSound is given a value rather than a Sound object

This commit is contained in:
TEParsons 2025-02-19 16:52:53 +00:00
parent 9265fd8502
commit b60e6d20ce

View File

@ -156,11 +156,10 @@ export class Sound extends PsychObject
{
if (!(sound instanceof Sound))
{
throw {
origin: "Sound.setSound",
context: "when setting the sound",
error: "the argument should be an instance of the Sound class.",
};
// if given something other than a Sound, do setValue instead
this.setValue(sound, log);
return this;
}
this._setAttribute("value", sound.value, log);