mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Merge pull request #1869 from apple502j/english-meow-meow
Always use English for kitten
This commit is contained in:
commit
ad6f15bfa1
1 changed files with 3 additions and 2 deletions
|
@ -457,20 +457,21 @@ class Scratch3Text2SpeechBlocks {
|
||||||
speakAndWait (args, util) {
|
speakAndWait (args, util) {
|
||||||
// Cast input to string
|
// Cast input to string
|
||||||
let words = Cast.toString(args.WORDS);
|
let words = Cast.toString(args.WORDS);
|
||||||
|
let locale = this.localeToPolly(this.getCurrentLanguage());
|
||||||
|
|
||||||
const state = this._getState(util.target);
|
const state = this._getState(util.target);
|
||||||
|
|
||||||
const gender = this.VOICE_INFO[state.voiceId].gender;
|
const gender = this.VOICE_INFO[state.voiceId].gender;
|
||||||
const playbackRate = this.VOICE_INFO[state.voiceId].playbackRate;
|
const playbackRate = this.VOICE_INFO[state.voiceId].playbackRate;
|
||||||
|
|
||||||
// @todo localize this?
|
|
||||||
if (state.voiceId === KITTEN_ID) {
|
if (state.voiceId === KITTEN_ID) {
|
||||||
words = words.replace(/\S+/g, 'meow');
|
words = words.replace(/\S+/g, 'meow');
|
||||||
|
locale = 'en-US';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build up URL
|
// Build up URL
|
||||||
let path = `${SERVER_HOST}/synth`;
|
let path = `${SERVER_HOST}/synth`;
|
||||||
path += `?locale=${this.localeToPolly(this.getCurrentLanguage())}`;
|
path += `?locale=${locale}`;
|
||||||
path += `&gender=${gender}`;
|
path += `&gender=${gender}`;
|
||||||
path += `&text=${encodeURIComponent(words.substring(0, 128))}`;
|
path += `&text=${encodeURIComponent(words.substring(0, 128))}`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue