added aquestalk speech block

This commit is contained in:
ocogeclub 2021-03-24 22:11:48 +09:00
parent 23281b6bd4
commit 7abefa0954
3 changed files with 31 additions and 3 deletions

View File

@ -748,6 +748,13 @@
<field name="data" id=")H{jxG09B6}[PcO%4H1d" variabletype="">データ</field>
</block>
<block type="ugj_child_julius"></block>
<block type="aquestalk_pi">
<value name="talk">
<shadow type="text">
<field name="TEXT">こんにちは</field>
</shadow>
</value>
</block>
<block type="ugj_child_openjtalk">
<field name="voice">m001</field>
<value name="talk">

View File

@ -12,8 +12,8 @@ function createWindow() {
win = new BrowserWindow({
/** Icon */
icon: "./icon.png",
width: 800,
height: 600,
width: 660,
height: 760,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
@ -76,7 +76,7 @@ app.on('ready', () => {
label: 'Mascot',
click: (item, focusedWindow) => {
if (focusedWindow)
focusedWindow.webContents.executeJavaScript('ugj_selectMascot()');
focusedWindow.webContents.executeJavaScript('ugj_selectMascot()');
},
accelerator: "CommandOrControl+M"
},

View File

@ -1967,6 +1967,27 @@ Blockly.JavaScript['ugj_child_gesture'] = function (block) {
return [code, Blockly.JavaScript.ORDER_NONE];
};
// AquesTalk Pi
Blockly.Blocks['aquestalk_pi'] = {
init: function () {
this.appendValueInput("talk")
.setCheck("String")
.appendField("ゆっくりで");
this.appendDummyInput()
.appendField("とおしゃべりする");
this.setInputsInline(true);
this.setOutput(true, "shcmd");
this.setStyle('special_blocks')
this.setTooltip("日本語音声合成プログラム「AquesTalk Pi」を使用してしゃべります。");
this.setHelpUrl("");
}
};
Blockly.JavaScript['aquestalk_pi'] = function (block) {
var value_talk = Blockly.JavaScript.valueToCode(block, 'talk', Blockly.JavaScript.ORDER_ATOMIC);
var code = `'./bin/aquestalkpi/AquesTalkPi ' + ${value_talk} + ' | aplay', { shell: true }`;
return [code, Blockly.JavaScript.ORDER_NONE];
};
// open jtalk
Blockly.Blocks['ugj_child_openjtalk'] = {
init: function () {