From 72491aff3c502d6cf6cb5d55f099ca2a1b479a31 Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Thu, 3 Dec 2020 20:56:02 +0000 Subject: [PATCH] sound/TonePlayer: call toMaster on volumeNode if toDestination missing --- js/sound/TonePlayer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/sound/TonePlayer.js b/js/sound/TonePlayer.js index 5c1405f..c98048e 100644 --- a/js/sound/TonePlayer.js +++ b/js/sound/TonePlayer.js @@ -339,8 +339,14 @@ export class TonePlayer extends SoundPlayer this._synth.connect(this._volumeNode); // connect the volume node to the master output: - this._volumeNode.toDestination(); - + if (typeof this._volumeNode.toDestination === 'function') + { + this._volumeNode.toDestination(); + } + else + { + this._volumeNode.toMaster(); + } } else {