mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
This kitten speaks only English
This commit is contained in:
parent
c26eeaede7
commit
cbf70d9609
1 changed files with 3 additions and 1 deletions
|
@ -457,6 +457,7 @@ class Scratch3Text2SpeechBlocks {
|
|||
speakAndWait (args, util) {
|
||||
// Cast input to string
|
||||
let words = Cast.toString(args.WORDS);
|
||||
let locale = this.localeToPolly(this.getCurrentLanguage());
|
||||
|
||||
const state = this._getState(util.target);
|
||||
|
||||
|
@ -466,11 +467,12 @@ class Scratch3Text2SpeechBlocks {
|
|||
// @todo localize this?
|
||||
if (state.voiceId === KITTEN_ID) {
|
||||
words = words.replace(/\S+/g, 'meow');
|
||||
locale = 'en-US';
|
||||
}
|
||||
|
||||
// Build up URL
|
||||
let path = `${SERVER_HOST}/synth`;
|
||||
path += `?locale=${this.localeToPolly(this.getCurrentLanguage())}`;
|
||||
path += `?locale=${locale}`;
|
||||
path += `&gender=${gender}`;
|
||||
path += `&text=${encodeURIComponent(words.substring(0, 128))}`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue