{"id":1573,"date":"2023-02-17T05:10:35","date_gmt":"2023-02-17T05:10:35","guid":{"rendered":"https:\/\/www.tools.keywordfinder.us\/?page_id=1573"},"modified":"2023-02-17T05:10:35","modified_gmt":"2023-02-17T05:10:35","slug":"voice-to-text","status":"publish","type":"page","link":"https:\/\/tools.billionsideas.com\/es\/voice-to-text\/","title":{"rendered":"Voice To Text"},"content":{"rendered":"<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column has-base-3-background-color has-background is-layout-flow wp-block-column-is-layout-flow\">\n<section><h1>Voice-to-Text Typing Tool<\/h1><br>\n\n    <div>\n      <textarea id=\"textarea\" rows=\"10\" cols=\"30\"><\/textarea>\n    <\/div>\n    <div>\n      <button id=\"start-btn\">Start<\/button>\n      <button id=\"stop-btn\">Stop<\/button>\n      <button id=\"copy-btn\">Copy Text<\/button>\n      <button id=\"download-btn\">Download Text<\/button><br><br>\n    <\/div><\/section>\n    <script>\n      const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;\n      const recognition = new SpeechRecognition();\n      const textarea = document.querySelector(\"#textarea\");\n      const startBtn = document.querySelector(\"#start-btn\");\n      const stopBtn = document.querySelector(\"#stop-btn\");\n      const copyBtn = document.querySelector(\"#copy-btn\");\n      const downloadBtn = document.querySelector(\"#download-btn\");\n      \n      recognition.interimResults = true;\n      recognition.continuous = true;\n      \n      let interimTranscript = '';\n      let finalTranscript = '';\n      \n      startBtn.addEventListener(\"click\", function() {\n        recognition.start();\n      });\n      \n      stopBtn.addEventListener(\"click\", function() {\n        recognition.stop();\n      });\n      \n      copyBtn.addEventListener(\"click\", function() {\n        textarea.select();\n        document.execCommand(\"copy\");\n      });\n      \n      downloadBtn.addEventListener(\"click\", function() {\n        const text = textarea.value;\n        const blob = new Blob([text], { type: \"text\/plain\" });\n        const a = document.createElement(\"a\");\n        a.style.display = \"none\";\n        a.href = URL.createObjectURL(blob);\n        a.download = \"text.txt\";\n        document.body.appendChild(a);\n        a.click();\n        document.body.removeChild(a);\n      });\n      \n      recognition.addEventListener(\"result\", function(event) {\n        interimTranscript = '';\n        for (let i = event.resultIndex, len = event.results.length; i < len; i++) {\n          let transcript = event.results[i][0].transcript;\n          if (event.results[i].isFinal) {\n            finalTranscript += transcript;\n            break;\n          } else {\n            interimTranscript += transcript;\n          }\n        }\n        textarea.value = finalTranscript + interimTranscript;\n      });\n    <\/script>\n  \n\n\n<style>\nsection{\n         margin-top:60px;\n        width: 100%;\n        max-width: 970px;\n        background-color: #fff;\n        border: 1px solid #ddd;\n        padding: 25px;\n      }\n<\/style>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Voice-to-Text Typing Tool Start Stop Copy Text Download Text<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","footnotes":""},"class_list":["post-1573","page","type-page","status-publish"],"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"Billions Ideas","author_link":"https:\/\/tools.billionsideas.com\/es\/author\/loginbillionsideas-com\/"},"comment_info":0,"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/pages\/1573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/comments?post=1573"}],"version-history":[{"count":0,"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/pages\/1573\/revisions"}],"wp:attachment":[{"href":"https:\/\/tools.billionsideas.com\/es\/wp-json\/wp\/v2\/media?parent=1573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}