{"id":6115,"date":"2025-10-13T18:15:29","date_gmt":"2025-10-13T16:15:29","guid":{"rendered":"https:\/\/gpmfactory.com\/?p=6115"},"modified":"2025-10-13T18:36:56","modified_gmt":"2025-10-13T16:36:56","slug":"enabling-speech-recognition-in-an-oracle-apex-application","status":"publish","type":"post","link":"https:\/\/gpmfactory.com\/index.php\/2025\/10\/13\/enabling-speech-recognition-in-an-oracle-apex-application\/","title":{"rendered":"Enabling Speech Recognition in an Oracle APEX application"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Goal<\/h3>\n\n\n\n<p>Enable speech recognition provided by most of the browser in a Text field or TextArea item in an Oracle APEX application<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"738\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-2.png\" alt=\"\" class=\"wp-image-6118\" style=\"width:414px;height:auto\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-2.png 1012w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-2-300x219.png 300w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-2-768x560.png 768w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><figcaption class=\"wp-element-caption\">Sample 1<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"780\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-6-1024x780.png\" alt=\"\" class=\"wp-image-6133\" style=\"width:415px;height:auto\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-6-1024x780.png 1024w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-6-300x229.png 300w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-6-768x585.png 768w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-6.png 1428w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Sample 2<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">CSS inline<\/h3>\n\n\n\n<p>The CCS must be added at the page level, in CSS Inline property<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.icon-inside-textarea {<br>position: absolute;<br>right: 20px;<br>bottom: 10px;<br>z-index: 10;<br>color: #888;<br>cursor: pointer;<br>}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Post Text<\/h3>\n\n\n\n<p>This markup must be added at the item level in the Post Text property<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;span class=\"icon-inside-textarea\"&gt;\n  &lt;span class=\"fa fa-lg fa-microphone\" id=\"<strong>mic-icon<\/strong>\"&gt;&lt;\/span&gt;\n&lt;\/span&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><br>Page Load DA<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"327\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-4.png\" alt=\"\" class=\"wp-image-6124\" style=\"width:462px;height:auto\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-4.png 875w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-4-300x112.png 300w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2025\/10\/image-4-768x287.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\ndocument.getElementById(\"<strong>mic-icon<\/strong>\").addEventListener(\"click\", function() {\n  console.log(\"Clic icon !\");\n  \/\/ V\u00e9rifier si le navigateur supporte la reconnaissance vocale\n  const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;\n  if (!SpeechRecognition) {\n    \/\/micBtn.disabled = true;\n    console.warn(\"Speech recognition non support\u00e9e sur ce navigateur.\");\n    return;\n  }\n console.warn(\"Scontinue.\");\n  const recognition = new SpeechRecognition();\n  recognition.lang = 'fr-FR'; \/\/ ajuster la langue \n  recognition.interimResults = false;\n  recognition.maxAlternatives = 1;\n\n  \/\/micBtn.addEventListener(\"click\", () =&gt; {\n    recognition.start();\n  \/\/});\n  recognition.onresult = function (event) {\n  \/\/ Concatenate new text with previous, if any.  \n  const transcript = event.results&#91;0]&#91;0].transcript;\n    prevnote = apex.item(\"<strong>P30_NOTE<\/strong>\").getValue();\n    apex.item(\"<strong>P30_NOTE<\/strong>\").setValue(prevnote.concat(transcript));\n  };\n\n  recognition.onerror = function (event) {\n    console.error(\"Erreur de reconnaissance vocale :\", event.error);\n    apex.message.showErrors(&#91;\n      {\n        type: \"error\",\n        location: \"page\",\n        message: \"\u00c9chec de la reconnaissance vocale : \" + event.error,\n        unsafe: false\n      }\n    ]);\n  };\n});<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Goal Enable speech recognition provided by most of the browser in a Text field or TextArea item in an Oracle APEX application CSS inline&#8230;<\/p>\n","protected":false},"author":1,"featured_media":6140,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[150],"class_list":["post-6115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-classe"],"authors":[{"term_id":150,"user_id":1,"is_guest":0,"slug":"admin8700","display_name":"Patrick","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/41853cbf3fae9c0c46c0ba5e68839a78c20aabbcd1db74702bbda2c9d3980676?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/6115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/comments?post=6115"}],"version-history":[{"count":15,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/6115\/revisions"}],"predecessor-version":[{"id":6142,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/6115\/revisions\/6142"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/media\/6140"}],"wp:attachment":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/media?parent=6115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/categories?post=6115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/tags?post=6115"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/ppma_author?post=6115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}