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

sound/TonePlayer: use gain to db when instantiating volume node

This commit is contained in:
Sotiri Bakagiannis 2021-07-26 12:22:39 +01:00
parent d21e70bb6d
commit 5e3bd47b42

View File

@ -332,7 +332,8 @@ export class TonePlayer extends SoundPlayer
this._synth = new Tone.Synth(this._synthOtions);
// connect it to a volume node:
this._volumeNode = new Tone.Volume(-60 + this._volume * 66);
this._volumeNode = new Tone.Volume(Tone.gainToDb(this._volume));
this._synth.connect(this._volumeNode);
// connect the volume node to the master output: