mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
Make a constant for speech volume
This commit is contained in:
parent
fe746a7c43
commit
36711931b2
1 changed files with 7 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue