{"id":3991,"date":"2023-07-21T15:13:29","date_gmt":"2023-07-21T15:13:29","guid":{"rendered":"https:\/\/sarav.in\/?p=3991"},"modified":"2023-07-21T15:13:30","modified_gmt":"2023-07-21T15:13:30","slug":"text-2","status":"publish","type":"post","link":"https:\/\/sarav.in\/?p=3991","title":{"rendered":"text"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<Style>\n body {\n    text-align: center;\n    font-family: Arial, sans-serif;\n}\n\nh1 {\n    color: #336699;\n}\n\nbutton {\n    padding: 10px 20px;\n    margin-top: 20px;\n    background-color: #336699;\n    color: #fff;\n    border: none;\n    cursor: pointer;\n}\n\n#outputContainer {\n    margin-top: 20px;\n    border: 1px solid #ccc;\n    padding: 10px;\n    text-align: left;\n}\n\n#outputTitle {\n    font-weight: bold;\n}\n\n#outputText {\n    margin-top: 10px;\n}\n\n<\/Style>\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Voice to Text Converter<\/title>\n<Title> Start Recording now !!! <\/title>\n  <link rel=\"stylesheet\" href=\"styles.css\">\n<\/head>\n<body>\n  <div class=\"container\">\n    <h1>Voice to Text Converter<\/h1>\n    <button id=\"startBtn\">Start Recording<\/button>\n    <p id=\"result\"><\/p>\n  <\/div>\n\n  <script src=\"script.js\"><\/script>\n  <script>\n    \/\/ Check if browser supports Web Speech API\nif ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {\n  const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();\n\n  recognition.continuous = true;\n  recognition.interimResults = true;\n\n  let isListening = false;\n  const startBtn = document.getElementById('startBtn');\n  const resultPara = document.getElementById('result');\n\n  recognition.onstart = () => {\n    isListening = true;\n    startBtn.textContent = 'Stop Recording';\n    resultPara.textContent = 'Listening...';\n  };\n\n  recognition.onend = () => {\n    isListening = false;\n    startBtn.textContent = 'Start Recording';\n    resultPara.textContent += ' (Recording Stopped)';\n  };\n\n  recognition.onresult = (event) => {\n    let transcript = '';\n    for (let i = event.resultIndex; i < event.results.length; i++) {\n      if (event.results[i].isFinal) {\n        transcript += event.results[i][0].transcript;\n      }\n    }\n    resultPara.textContent = transcript;\n  };\n\n  startBtn.addEventListener('click', () => {\n    if (isListening) {\n      recognition.stop();\n    } else {\n      recognition.start();\n    }\n  });\n  copyBtn.addEventListener('click', () => {\n    const textToCopy = resultPara.textContent;\n    if (textToCopy) {\n      navigator.clipboard.writeText(textToCopy).then(() => {\n        alert('Text copied to clipboard!');\n      }).catch((err) => {\n        console.error('Error copying text: ', err);\n      });\n    }\n} else {\n  alert('Web Speech API is not supported in this browser. Please try using Chrome or Edge.');\n}\n\n  <\/script>\n<\/body>\n<\/html>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_3991\" class=\"pvc_stats all  \" data-element-id=\"3991\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" loading=\"lazy\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/sarav.in\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Voice to Text Converter Start Recording now !!! Voice to Text Converter Start Recording<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_3991\" class=\"pvc_stats all  \" data-element-id=\"3991\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" loading=\"lazy\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/sarav.in\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amazonpipp_noncename":"","amazon-product-isactive":"","amazon-product-single-asin":"","amazon-product-content-location":"","amazon-product-content-hook-override":"","amazon-product-excerpt-hook-override":"","amazon-product-singular-only":"","amazon-product-amazon-desc":"","amazon-product-show-gallery":"","amazon-product-show-features":"","amazon-product-newwindow":"","amazon-product-show-list-price":"","amazon-product-show-used-price":"","amazon-product-show-saved-amt":"","amazon-product-timestamp":"","amazon-product-new-title":"","amazon-product-use-cartURL":"","amazon_featured_post_meta_key":"","_amazon_featured_alt":"","amazon-product-template":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/posts\/3991"}],"collection":[{"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sarav.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3991"}],"version-history":[{"count":1,"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/posts\/3991\/revisions"}],"predecessor-version":[{"id":3992,"href":"https:\/\/sarav.in\/index.php?rest_route=\/wp\/v2\/posts\/3991\/revisions\/3992"}],"wp:attachment":[{"href":"https:\/\/sarav.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sarav.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sarav.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}