[{"id":"ee60c3e3.69e03","type":"mysql","z":"98f4cc17.965b","mydb":"7c738c44.e9a364","name":"DB_MYSQL","x":670,"y":260,"wires":[[]]},{"id":"5d766314.29f91c","type":"function","z":"98f4cc17.965b","name":"Verify Speech","func":"var topic =msg.topic;\nmsg.topic = \"SELECT VOICE FROM USER\";//data voice from database\n\nvar transcription =msg.transcription;//data from microphone (input data)\n\n\nif(topic==transcription){\n \n //upload name to history database from user database\n msg.topic = INSERT INTO HISTORY (NAME) VALUES (SELECT NAME FROM USER WHERE VOICE = transcription);\n \n //audio sound\n msg.payload=\"Welcome\";\n \n \n}\n\nif(topic!=transcription){\n \n //audio sound\n msg.payload=\"Access Denied\";\n \n}","outputs":2,"noerr":17,"x":420,"y":320,"wires":[["ee60c3e3.69e03","5c178158.4733f"],["91d9fd2a.af375"]]},{"id":"2b9d8dd1.390142","type":"watson-speech-to-text","z":"98f4cc17.965b","name":"","alternatives":1,"speakerlabels":true,"smartformatting":false,"lang":"en-US","langhidden":"en-US","langcustom":"NoCustomisationSetting","langcustomhidden":"","custom-weight":"0.5","band":"NarrowbandModel","bandhidden":"NarrowbandModel","keywords":"","keywords-threshold":"0.5","word-confidence":false,"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":160,"y":340,"wires":[["338d77fb.3e9f88","5d766314.29f91c"]]},{"id":"9c343afa.80e438","type":"microphone","z":"98f4cc17.965b","name":"","x":110,"y":240,"wires":[["2b9d8dd1.390142"]]},{"id":"338d77fb.3e9f88","type":"debug","z":"98f4cc17.965b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"transcription","targetType":"msg","x":410,"y":380,"wires":[]},{"id":"595861ce.b689c","type":"play audio","z":"98f4cc17.965b","name":"Access Denied","voice":"0","x":880,"y":400,"wires":[]},{"id":"d44f4fcb.4f531","type":"play audio","z":"98f4cc17.965b","name":"Welcome","voice":"0","x":880,"y":320,"wires":[]},{"id":"67ca3d11.6eb434","type":"comment","z":"98f4cc17.965b","name":"","info":"Verify the speech from microphone are same with “VOICE” in User table or not.\n\nIf same, then upload that particular user's name to HISTORY table and with the output sound \"Welcome\".\n\nIf not same just output sound \"Access denied\".","x":400,"y":280,"wires":[]},{"id":"4944a410.7d505c","type":"comment","z":"98f4cc17.965b","name":"","info":"To see the speech from microphone to let us can check the speech is from microphone is what we want speech.","x":420,"y":420,"wires":[]},{"id":"91d9fd2a.af375","type":"watson-text-to-speech","z":"98f4cc17.965b","name":"","lang":"en-GB","langhidden":"en-GB","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"en-GB_KateV3Voice","voicehidden":"","format":"audio/wav","password":"","apikey":"kxIPJUsW_2zjWfDnhr8yNS4oPK5BPM4ywQGbZcQL9ZLl","payload-response":false,"service-endpoint":"https://api.us-south.text-to-speech.watson.cloud.ibm.com/instances/2ead23d4-2528-416d-8e53-c40a658d6bfd","x":680,"y":400,"wires":[["595861ce.b689c"]]},{"id":"5c178158.4733f","type":"watson-text-to-speech","z":"98f4cc17.965b","name":"","lang":"en-GB","langhidden":"en-GB","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"en-GB_KateV3Voice","voicehidden":"","format":"audio/wav","password":"","apikey":"kxIPJUsW_2zjWfDnhr8yNS4oPK5BPM4ywQGbZcQL9ZLl","payload-response":false,"service-endpoint":"https://api.us-south.text-to-speech.watson.cloud.ibm.com/instances/2ead23d4-2528-416d-8e53-c40a658d6bfd","x":680,"y":320,"wires":[["d44f4fcb.4f531"]]},{"id":"7c738c44.e9a364","type":"MySQLdatabase","z":"","host":"165.22.51.44","port":"3306","db":"hireelec_vaes","tz":""}]
this is the flow ...