From 36711931b28fc90cd0a49ad9da7c6c260814e32d Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Wed, 5 Sep 2018 18:36:01 -0400 Subject: [PATCH] Make a constant for speech volume --- src/extensions/scratch3_text2speech/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extensions/scratch3_text2speech/index.js b/src/extensions/scratch3_text2speech/index.js index 1990b3fa1..b3fd08fca 100644 --- a/src/extensions/scratch3_text2speech/index.js +++ b/src/extensions/scratch3_text2speech/index.js @@ -19,6 +19,12 @@ const SERVER_HOST = 'https://synthesis-service.scratch.mit.edu'; */ const SERVER_TIMEOUT = 10000; // 10 seconds +/** + * Volume for playback of speech sounds, as a percentage. + * @type {number} + */ +const SPEECH_VOLUME = 250; + /** * An id for one of the voices. */ @@ -357,7 +363,7 @@ class Scratch3SpeakBlocks { // Increase the volume const engine = this.runtime.audioEngine; const chain = engine.createEffectChain(); - chain.set('volume', 250); + chain.set('volume', SPEECH_VOLUME); soundPlayer.connect(chain); soundPlayer.play();