Node-REDを使ってみる その7(VOICEVOXエンジン、日本語の音声合成)
はじめに
今回はNode-REDでVOICEVOXエンジンのAPIを利用してみました。
以前VOICEVOX COREを用いた音声合成については試したことがあります。
▼こちらの記事で試していました。
VOICEVOXではGPUの利用にも対応しているようです。ローカルネットワーク内でAPIとして利用することで、処理を分散させたいというのもあって試してみました。
▼以前の記事はこちら
VOICEVOXのインストール
▼以下のページからインストーラをダウンロードし、実行しました。
インストール後、問題なく起動できました。
▼サンプルボイスを視聴することができます。

VOICEVOX Nemoも追加しておきました。
▼VOICEVOX Nemoのページはこちら
https://voicevox.hiroshiba.jp/nemo
▼VOICEVOXのマルチエンジン機能を有効化してから、ダウンロードしたものを実行して追加しました。

▼問題なく追加されました。

エンジンが問題なく起動していれば、http://localhost:50021/docsにアクセスすればAPIのドキュメントが表示されます。
▼この後APIを利用するときにも参考にします。

▼VOICEVOX Nemoの場合は、50121ポートにアクセスするとドキュメントが表示されました。

Node-REDでAPIを利用する
基本的なノードでの動作確認
Node-REDでVOICEVOX NemoのAPIを利用します。まずは話者のIDを確認します。
▼http://localhost:50121/speakersにGETリクエストを行ったところ、nameやidなどの情報が得られました。


このままでは分かりにくいので、値にアクセスして見やすくします。
▼文字列からJSON形式にパースすると、配列の中に入っているJSON形式として得られました。

▼msg.payload.0にchangeノードでアクセスすると、配列の0番目の値を取得できました。


versionやsupported_featuresなどのプロパティは削除して、IDと種類が分かるようなJSON形式としてまとめました。splitノードとjoinノードを使います。
▼以下のフローを作成しました。

[{"id":"b9caa0835b3fd992","type":"http request","z":"f28b25c4e0768aca","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://localhost:50121/speakers","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":730,"y":340,"wires":[["f67f8308e0a19afb","195e4b8ad12f0d98"]]},{"id":"f67f8308e0a19afb","type":"debug","z":"f28b25c4e0768aca","name":"debug 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":340,"wires":[]},{"id":"739e363d9a2ce7fa","type":"inject","z":"f28b25c4e0768aca","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":570,"y":340,"wires":[["b9caa0835b3fd992"]]},{"id":"195e4b8ad12f0d98","type":"json","z":"f28b25c4e0768aca","name":"","property":"payload","action":"","pretty":false,"x":710,"y":400,"wires":[["70f95ad122144409","3b84c87f97356d1d","6b38b85e9322f08f"]]},{"id":"70f95ad122144409","type":"debug","z":"f28b25c4e0768aca","name":"debug 5","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":860,"y":400,"wires":[]},{"id":"3b84c87f97356d1d","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":460,"wires":[["36a428c398a6e344"]]},{"id":"36a428c398a6e344","type":"debug","z":"f28b25c4e0768aca","name":"debug 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":460,"wires":[]},{"id":"6b38b85e9322f08f","type":"split","z":"f28b25c4e0768aca","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":590,"y":520,"wires":[["e821d4bdca20ce86"]]},{"id":"221a61d9a837b947","type":"join","z":"f28b25c4e0768aca","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":790,"y":640,"wires":[["52da36ef75acebd0","05d746070733affa"]]},{"id":"e821d4bdca20ce86","type":"change","z":"f28b25c4e0768aca","name":"Delete","rules":[{"t":"delete","p":"payload.speaker_uuid","pt":"msg"},{"t":"delete","p":"payload.supported_features","pt":"msg"},{"t":"delete","p":"payload.version","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":520,"wires":[["16df1344ce6b2fd2"]]},{"id":"7db2475eb420a269","type":"split","z":"f28b25c4e0768aca","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":590,"y":580,"wires":[["f268d3509d423fd0"]]},{"id":"920ed640a710a9b7","type":"join","z":"f28b25c4e0768aca","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1030,"y":580,"wires":[["1b5775b7e760983b"]]},{"id":"16df1344ce6b2fd2","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"name","pt":"msg","to":"payload.name","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.styles","tot":"msg"},{"t":"set","p":"parts1","pt":"msg","to":"parts","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":520,"wires":[["7db2475eb420a269"]]},{"id":"f0993736f75d0e7c","type":"template","z":"f28b25c4e0768aca","name":"Payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{name}}_{{payload.name}}\n","output":"str","x":880,"y":580,"wires":[["920ed640a710a9b7"]]},{"id":"f268d3509d423fd0","type":"template","z":"f28b25c4e0768aca","name":"Topic","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"id_{{payload.id}}","output":"str","x":730,"y":580,"wires":[["f0993736f75d0e7c"]]},{"id":"1b5775b7e760983b","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"parts1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":640,"wires":[["221a61d9a837b947"]]},{"id":"52da36ef75acebd0","type":"debug","z":"f28b25c4e0768aca","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":940,"y":640,"wires":[]}]後でDashboard 2.0で表示するときに、ドロップダウンで選択して、IDを代入できるようにします。
VOICEVOXで音声合成を行い、そのデータを取得できるようにします。/audio_queryにテキストと話者のIDを渡し、その結果を/synthesisに送ります。その後、出力された音声ファイルのバイナリバッファをplay audioノードで再生できるようにしました。
▼フローはこちら

[{"id":"d31a98a68ff75bd3","type":"http request","z":"f28b25c4e0768aca","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":710,"y":1480,"wires":[["0405cd21fdf2b09b","a2bbbee44d259c26"]]},{"id":"2b2a56b10b2408ba","type":"inject","z":"f28b25c4e0768aca","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"こんにちは","payloadType":"str","x":520,"y":1320,"wires":[["612a1732b5394555"]]},{"id":"0405cd21fdf2b09b","type":"debug","z":"f28b25c4e0768aca","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":880,"y":1480,"wires":[]},{"id":"0678c6e8082fcf3e","type":"http request","z":"f28b25c4e0768aca","name":"","method":"POST","ret":"bin","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":750,"y":1560,"wires":[["833170205dc3278d","cbd23893c35b115b"]]},{"id":"833170205dc3278d","type":"debug","z":"f28b25c4e0768aca","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":1560,"wires":[]},{"id":"cbd23893c35b115b","type":"play audio","z":"f28b25c4e0768aca","name":"","voice":"5","x":930,"y":1620,"wires":[]},{"id":"ec4a41265b04f4cd","type":"template","z":"f28b25c4e0768aca","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"http://localhost:50121/audio_query?text={{payload}}&speaker={{id}}","output":"str","x":540,"y":1480,"wires":[["d31a98a68ff75bd3"]]},{"id":"5ecaed5f852c29fc","type":"inject","z":"f28b25c4e0768aca","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"はじめまして","payloadType":"str","x":530,"y":1360,"wires":[["612a1732b5394555"]]},{"id":"1c9680f9b8804a43","type":"inject","z":"f28b25c4e0768aca","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Node-REDで音声を再生しています","payloadType":"str","x":600,"y":1400,"wires":[["612a1732b5394555"]]},{"id":"a2bbbee44d259c26","type":"template","z":"f28b25c4e0768aca","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"http://localhost:50121/synthesis?speaker={{id}}","output":"str","x":540,"y":1560,"wires":[["0678c6e8082fcf3e"]]},{"id":"612a1732b5394555","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"id","pt":"msg","to":"10006","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":1320,"wires":[["ec4a41265b04f4cd"]]},{"id":"fe54dbadfb17fef1","type":"global-config","env":[],"modules":{"node-red-contrib-play-audio":"2.5.0"}}]これで最初のinjectノードで渡したテキストを話す音声が再生されるようになりました。
Dashboard 2.0との組み合わせ
先程作成したフローをもとに、ドロップダウンで話者を選択し、入力したテキストを元に音声の合成を行うようにします。
▼作成したフローはこちら。

[{"id":"b9caa0835b3fd992","type":"http request","z":"f28b25c4e0768aca","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://localhost:50121/speakers","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":730,"y":340,"wires":[["f67f8308e0a19afb","195e4b8ad12f0d98"]]},{"id":"f67f8308e0a19afb","type":"debug","z":"f28b25c4e0768aca","name":"debug 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":340,"wires":[]},{"id":"739e363d9a2ce7fa","type":"inject","z":"f28b25c4e0768aca","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":570,"y":340,"wires":[["b9caa0835b3fd992"]]},{"id":"195e4b8ad12f0d98","type":"json","z":"f28b25c4e0768aca","name":"","property":"payload","action":"","pretty":false,"x":710,"y":400,"wires":[["70f95ad122144409","3b84c87f97356d1d","6b38b85e9322f08f"]]},{"id":"70f95ad122144409","type":"debug","z":"f28b25c4e0768aca","name":"debug 5","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":860,"y":400,"wires":[]},{"id":"3b84c87f97356d1d","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":460,"wires":[["36a428c398a6e344"]]},{"id":"36a428c398a6e344","type":"debug","z":"f28b25c4e0768aca","name":"debug 3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":460,"wires":[]},{"id":"6b38b85e9322f08f","type":"split","z":"f28b25c4e0768aca","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":590,"y":520,"wires":[["e821d4bdca20ce86"]]},{"id":"221a61d9a837b947","type":"join","z":"f28b25c4e0768aca","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":790,"y":640,"wires":[["52da36ef75acebd0","05d746070733affa"]]},{"id":"e821d4bdca20ce86","type":"change","z":"f28b25c4e0768aca","name":"Delete","rules":[{"t":"delete","p":"payload.speaker_uuid","pt":"msg"},{"t":"delete","p":"payload.supported_features","pt":"msg"},{"t":"delete","p":"payload.version","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":520,"wires":[["16df1344ce6b2fd2"]]},{"id":"7db2475eb420a269","type":"split","z":"f28b25c4e0768aca","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":590,"y":580,"wires":[["f268d3509d423fd0"]]},{"id":"920ed640a710a9b7","type":"join","z":"f28b25c4e0768aca","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1030,"y":580,"wires":[["1b5775b7e760983b"]]},{"id":"16df1344ce6b2fd2","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"name","pt":"msg","to":"payload.name","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.styles","tot":"msg"},{"t":"set","p":"parts1","pt":"msg","to":"parts","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":520,"wires":[["7db2475eb420a269"]]},{"id":"f0993736f75d0e7c","type":"template","z":"f28b25c4e0768aca","name":"Payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{name}}_{{payload.name}}\n","output":"str","x":880,"y":580,"wires":[["920ed640a710a9b7"]]},{"id":"f268d3509d423fd0","type":"template","z":"f28b25c4e0768aca","name":"Topic","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"id_{{payload.id}}","output":"str","x":730,"y":580,"wires":[["f0993736f75d0e7c"]]},{"id":"1b5775b7e760983b","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"parts1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":640,"wires":[["221a61d9a837b947"]]},{"id":"52da36ef75acebd0","type":"debug","z":"f28b25c4e0768aca","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":940,"y":640,"wires":[]},{"id":"d31a98a68ff75bd3","type":"http request","z":"f28b25c4e0768aca","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":910,"y":1020,"wires":[["0405cd21fdf2b09b","a2bbbee44d259c26"]]},{"id":"0405cd21fdf2b09b","type":"debug","z":"f28b25c4e0768aca","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1080,"y":1020,"wires":[]},{"id":"0678c6e8082fcf3e","type":"http request","z":"f28b25c4e0768aca","name":"","method":"POST","ret":"bin","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":950,"y":1080,"wires":[["833170205dc3278d","cbd23893c35b115b"]]},{"id":"833170205dc3278d","type":"debug","z":"f28b25c4e0768aca","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1120,"y":1080,"wires":[]},{"id":"cbd23893c35b115b","type":"play audio","z":"f28b25c4e0768aca","name":"","voice":"5","x":1130,"y":1140,"wires":[]},{"id":"ec4a41265b04f4cd","type":"template","z":"f28b25c4e0768aca","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"http://localhost:50121/audio_query?text={{payload}}&speaker={{id}}","output":"str","x":740,"y":1020,"wires":[["d31a98a68ff75bd3"]]},{"id":"a2bbbee44d259c26","type":"template","z":"f28b25c4e0768aca","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"http://localhost:50121/synthesis?speaker={{id}}","output":"str","x":740,"y":1080,"wires":[["0678c6e8082fcf3e"]]},{"id":"dc27390497117a10","type":"ui-dropdown","z":"f28b25c4e0768aca","group":"dbf1aaba5df056c8","name":"","label":"Select Option:","tooltip":"","order":1,"width":0,"height":0,"passthru":false,"multiple":false,"chips":false,"clearable":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","typeIsComboBox":true,"msgTrigger":"onChange","x":820,"y":800,"wires":[["3ab166925201cc46","8f17aff9ad3d4132"]]},{"id":"05d746070733affa","type":"split","z":"f28b25c4e0768aca","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"key","property":"payload","x":590,"y":720,"wires":[["6edf75e052aa05cd"]]},{"id":"f86fd5f435a9dbf5","type":"join","z":"f28b25c4e0768aca","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1090,"y":720,"wires":[["73b8da4a8eb4f1bb"]]},{"id":"6edf75e052aa05cd","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"change","p":"key","pt":"msg","from":"id_","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":720,"wires":[["1f372d3e2111762d"]]},{"id":"1f372d3e2111762d","type":"template","z":"f28b25c4e0768aca","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"value\": \"{{key}}\",\n \"label\": \"{{payload}}\"\n}","output":"json","x":940,"y":720,"wires":[["f86fd5f435a9dbf5"]]},{"id":"73b8da4a8eb4f1bb","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":800,"wires":[["dc27390497117a10"]]},{"id":"3ab166925201cc46","type":"debug","z":"f28b25c4e0768aca","name":"debug 8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":800,"wires":[]},{"id":"8f17aff9ad3d4132","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"voicevox_id","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":840,"wires":[[]]},{"id":"00027caa7012d429","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"id","pt":"msg","to":"voicevox_id","tot":"flow"},{"t":"set","p":"payload","pt":"msg","to":"voicevox_text","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":960,"wires":[["ec4a41265b04f4cd"]]},{"id":"0c10be747b97b86d","type":"ui-button","z":"f28b25c4e0768aca","group":"dbf1aaba5df056c8","name":"","label":"Synthesis","order":3,"width":0,"height":0,"emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":580,"y":960,"wires":[["00027caa7012d429"]]},{"id":"588a92ef6c35d5f1","type":"ui-text-input","z":"f28b25c4e0768aca","group":"dbf1aaba5df056c8","name":"","label":"Text","order":2,"width":"0","height":"0","topic":"topic","topicType":"msg","mode":"text","tooltip":"","delay":300,"passthru":true,"sendOnDelay":false,"sendOnBlur":true,"sendOnEnter":true,"className":"","clearable":false,"sendOnClear":false,"icon":"","iconPosition":"left","iconInnerPosition":"inside","x":570,"y":900,"wires":[["2709d555d8a676eb"]]},{"id":"2709d555d8a676eb","type":"change","z":"f28b25c4e0768aca","name":"","rules":[{"t":"set","p":"voicevox_text","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":900,"wires":[[]]},{"id":"e5045c0f42e273d0","type":"comment","z":"f28b25c4e0768aca","name":"For Dropdown","info":"","x":550,"y":680,"wires":[]},{"id":"dbf1aaba5df056c8","type":"ui-group","name":"Request","page":"d51a02377692e5e7","width":6,"height":1,"order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"d51a02377692e5e7","type":"ui-page","name":"VOICEVOX","ui":"5259dd30612d8960","path":"/page2","icon":"home","layout":"grid","theme":"058cd637c69323b8","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":1,"className":"","visible":"true","disabled":"false"},{"id":"5259dd30612d8960","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"page","navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true,"allowInstall":false},{"id":"058cd637c69323b8","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}},{"id":"bf5465f9570bd243","type":"global-config","env":[],"modules":{"node-red-contrib-play-audio":"2.5.0","@flowfuse/node-red-dashboard":"1.30.1"}}]▼実際のダッシュボード画面はこんな感じ。

▼ドロップダウンで選択すると、IDが出力されます。

これでダッシュボード画面で入力したテキストの音声が再生されるようになりました。
GPU版の確認
NVIDIA系のGPUならGPUモードも利用できるようです。設定→オプションの欄で設定しました。
▼エンジンモードを変更したところ、最初にGPUの確認がありました。

私のPCはNVIDIA系のRTX 3050 Laptopが搭載されています。
▼PCは10万円ぐらいで購入したゲーミングノートPCを利用しています。
Ollamaでgpt-oss:20bを利用して、長めのテスト用のテキストを生成してもらいました。
皆さま、注意喚起のご案内です。 12月25日 16:00(本日)から、当社サーバーは定期メンテナンスを実施いたします。 メンテナンス期間は、16:00〜18:30を予定しております。 この間、以下のサービスがご利用いただけません。 ユーザープロファイル閲覧機能 購入履歴検索機能 オンライン決済機能 ご不便をお掛けしますが、安全性向上のためご協力をお願いいたします。 メンテナンス完了後は、正常に復旧します。復旧時間は、再び本日 18:30頃を予定しております。 なお、万が一サーバー障害が発生した場合は、当社サポートセンターへお問い合わせください。 24時間対応で、お客様のご質問・ご要望に迅速に対応いたします。CPU版では10秒ぐらい、GPU版では5秒ぐらいかかりました。初回だけCPU版で30秒ぐらいかかることがありました。PCの性能にもよるかと思いますが、私の環境ではGPU版の方が速そうでした。
最後に
Node-REDでVOICEVOXのAPIを利用することができました。他のノードと組み合わせて使うことができそうです。
自宅でサーバーとして利用しているJetson XavierでもVOICEVOXを利用できるようにしたいなと思っています。



