mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Set tenor playback rate for single gender languages
This commit is contained in:
parent
0d12cead31
commit
5b5c0d80eb
1 changed files with 14 additions and 2 deletions
|
@ -65,6 +65,11 @@ const GIANT_ID = 'GIANT';
|
||||||
*/
|
*/
|
||||||
const KITTEN_ID = 'KITTEN';
|
const KITTEN_ID = 'KITTEN';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Playback rate for the tenor voice, for cases where we have only a female gender voice.
|
||||||
|
*/
|
||||||
|
const TENOR_RATE = 0.9;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for the text2speech blocks.
|
* Class for the text2speech blocks.
|
||||||
* @constructor
|
* @constructor
|
||||||
|
@ -499,8 +504,15 @@ class Scratch3Text2SpeechBlocks {
|
||||||
|
|
||||||
const state = this._getState(util.target);
|
const state = this._getState(util.target);
|
||||||
|
|
||||||
const gender = this.VOICE_INFO[state.voiceId].gender;
|
let gender = this.VOICE_INFO[state.voiceId].gender;
|
||||||
const playbackRate = this.VOICE_INFO[state.voiceId].playbackRate;
|
let playbackRate = this.VOICE_INFO[state.voiceId].playbackRate;
|
||||||
|
|
||||||
|
if (this.LANGUAGE_INFO[this.getCurrentLanguage()].singleGender) {
|
||||||
|
gender = 'female';
|
||||||
|
if (state.voiceId === TENOR_ID) {
|
||||||
|
playbackRate = TENOR_RATE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (state.voiceId === KITTEN_ID) {
|
if (state.voiceId === KITTEN_ID) {
|
||||||
words = words.replace(/\S+/g, 'meow');
|
words = words.replace(/\S+/g, 'meow');
|
||||||
|
|
Loading…
Reference in a new issue