mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -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';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @constructor
|
||||
|
@ -499,8 +504,15 @@ class Scratch3Text2SpeechBlocks {
|
|||
|
||||
const state = this._getState(util.target);
|
||||
|
||||
const gender = this.VOICE_INFO[state.voiceId].gender;
|
||||
const playbackRate = this.VOICE_INFO[state.voiceId].playbackRate;
|
||||
let gender = this.VOICE_INFO[state.voiceId].gender;
|
||||
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) {
|
||||
words = words.replace(/\S+/g, 'meow');
|
||||
|
|
Loading…
Reference in a new issue