mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -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
|
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.
|
* An id for one of the voices.
|
||||||
*/
|
*/
|
||||||
|
@ -357,7 +363,7 @@ class Scratch3SpeakBlocks {
|
||||||
// Increase the volume
|
// Increase the volume
|
||||||
const engine = this.runtime.audioEngine;
|
const engine = this.runtime.audioEngine;
|
||||||
const chain = engine.createEffectChain();
|
const chain = engine.createEffectChain();
|
||||||
chain.set('volume', 250);
|
chain.set('volume', SPEECH_VOLUME);
|
||||||
soundPlayer.connect(chain);
|
soundPlayer.connect(chain);
|
||||||
|
|
||||||
soundPlayer.play();
|
soundPlayer.play();
|
||||||
|
|
Loading…
Reference in a new issue