[{"id":"43555fcb.61e95","type":"tab","label":"VAES_project","disabled":false,"info":""},{"id":"842ac2b4.3af0a","type":"mysql","z":"43555fcb.61e95","mydb":"7c738c44.e9a364","name":"DB_MYSQL","x":510,"y":300,"wires":[["f820ef9f.254e7"]]},{"id":"41d8f9da.5c2498","type":"switch","z":"43555fcb.61e95","name":"verify empty/no empty","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":160,"y":320,"wires":[["c5a1b4ed.2825c8","69b8edb2.191f54"],["bcf023c3.faa4a"]]},{"id":"c5a1b4ed.2825c8","type":"function","z":"43555fcb.61e95","name":"upload name data","func":"var spokenAsText = msg.payload;// or where ever the speech to text is\nvar SQL = \"INSERT INTO HISTORY (NAME) SELECT NAME FROM USER WHERE VOICE= '\" + spokenAsText + \"'\";\nmsg.topic = SQL; \nreturn msg;","outputs":1,"noerr":0,"x":530,"y":400,"wires":[["842ac2b4.3af0a"]]},{"id":"f820ef9f.254e7","type":"json","z":"43555fcb.61e95","name":"","property":"payload","action":"","pretty":false,"x":670,"y":300,"wires":[["92616f60.2df43"]]},{"id":"92616f60.2df43","type":"debug","z":"43555fcb.61e95","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":830,"y":300,"wires":[]},{"id":"dd9ee22f.8fbe2","type":"debug","z":"43555fcb.61e95","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":750,"y":540,"wires":[]},{"id":"69b8edb2.191f54","type":"change","z":"43555fcb.61e95","name":"set welcome sound","rules":[{"t":"set","p":"payload","pt":"msg","to":"welcome","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":460,"wires":[["dd9ee22f.8fbe2","78077300.fa3dfc"]]},{"id":"bcf023c3.faa4a","type":"change","z":"43555fcb.61e95","name":"set access denied sound","rules":[{"t":"set","p":"payload","pt":"msg","to":"access denied","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":520,"wires":[["dd9ee22f.8fbe2","78077300.fa3dfc"]]},{"id":"3126e3bc.b9985c","type":"watson-speech-to-text","z":"43555fcb.61e95","name":"","alternatives":"3","speakerlabels":true,"smartformatting":true,"lang":"en-US","langhidden":"en-US","langcustom":"NoCustomisationSetting","langcustomhidden":"","custom-weight":"0.5","band":"NarrowbandModel","bandhidden":"NarrowbandModel","keywords":"","keywords-threshold":"0.5","word-confidence":true,"password":"","apikey":"aEfplzvlM_B8MA01nsDy3fj6b3CnG6dOQEGISr2gHxxk","payload-response":true,"streaming-mode":false,"streaming-mute":false,"auto-connect":false,"discard-listening":false,"disable-precheck":false,"service-endpoint":"https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/4ec7115d-1cbf-4ac7-b141-9c9a675fbdac","x":480,"y":980,"wires":[["627d8e3.4f0947"]]},{"id":"462b985a.b52748","type":"microphone","z":"43555fcb.61e95","name":"","x":290,"y":980,"wires":[["3126e3bc.b9985c"]]},{"id":"627d8e3.4f0947","type":"debug","z":"43555fcb.61e95","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":980,"wires":[]},{"id":"7f524d5d.018134","type":"watson-speech-to-text","z":"43555fcb.61e95","name":"","alternatives":1,"speakerlabels":true,"smartformatting":true,"lang":"en-US","langhidden":"en-US","langcustom":"NoCustomisationSetting","langcustomhidden":"","custom-weight":"0.5","band":"NarrowbandModel","bandhidden":"NarrowbandModel","keywords":"","keywords-threshold":"0.5","word-confidence":true,"password":"","apikey":"aEfplzvlM_B8MA01nsDy3fj6b3CnG6dOQEGISr2gHxxk","payload-response":true,"streaming-mode":false,"streaming-mute":false,"auto-connect":false,"discard-listening":false,"disable-precheck":false,"service-endpoint":"https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/4ec7115d-1cbf-4ac7-b141-9c9a675fbdac","x":280,"y":160,"wires":[["2d9ab90d.74b916"]]},{"id":"150b84f1.3b278b","type":"microphone","z":"43555fcb.61e95","name":"","x":110,"y":160,"wires":[["7f524d5d.018134"]]},{"id":"ee4ddd08.39f53","type":"function","z":"43555fcb.61e95","name":"compare data","func":"//msg.payload = msg.payload.trim();\nvar spokenAsText = msg.payload// or where ever the speech to text is\nvar SQL = \"SELECT * FROM USER WHERE VOICE = '\" + spokenAsText + \"' AND VERIFY = 1 LIMIT 1\";\nmsg.topic = SQL; \nreturn msg;","outputs":1,"noerr":0,"x":500,"y":160,"wires":[["608fffb.97ae3","5f16bb2c.67b5c4"]]},{"id":"608fffb.97ae3","type":"mysql","z":"43555fcb.61e95","mydb":"7c738c44.e9a364","name":"DB_MYSQL","x":690,"y":160,"wires":[["4726c75f.7ffc48","41d8f9da.5c2498"]]},{"id":"4726c75f.7ffc48","type":"debug","z":"43555fcb.61e95","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":120,"wires":[]},{"id":"5f16bb2c.67b5c4","type":"debug","z":"43555fcb.61e95","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":120,"wires":[]},{"id":"78077300.fa3dfc","type":"play audio","z":"43555fcb.61e95","name":"","voice":"4","x":750,"y":480,"wires":[]},{"id":"2d9ab90d.74b916","type":"function","z":"43555fcb.61e95","name":"trim()","func":"msg.payload = msg.payload.trim();\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":60,"wires":[["ee4ddd08.39f53"]]},{"id":"7c738c44.e9a364","type":"MySQLdatabase","z":"","host":"165.22.51.44","port":"3306","db":"hireelec_vaes","tz":""}]
it compare speech to text
with database in USER VOICE, if have same, then it will show output...if no have same, then it will show empty...then i can verify it is empty or no...