Changeset 3159744
- Timestamp:
- 09/30/2024 10:19:44 AM (18 months ago)
- Location:
- speech-to-text-for-wpforms
- Files:
-
- 4 added
- 3 edited
-
tags/1.0.0 (added)
-
tags/1.0.0/README.txt (added)
-
tags/1.0.0/voxinput.js (added)
-
tags/1.0.0/voxinput.php (added)
-
trunk/README.txt (modified) (5 diffs)
-
trunk/voxinput.js (modified) (6 diffs)
-
trunk/voxinput.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
speech-to-text-for-wpforms/trunk/README.txt
r3116680 r3159744 3 3 Tags: wpforms, form, voice recognition, voice input, whisper, stt, tts, ai 4 4 Requires at least: 5.5 5 Tested up to: 6. 5.36 Stable tag: 1. 0.05 Tested up to: 6.6.1 6 Stable tag: 1.1.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 12 12 13 13 == Description == 14 Speech to Text for WPForms revolutionizes form filling by enabling users to input text into WPForms forms using their voice. This plugin leverages the cutting-edge Whisper voice recognition technology and OpenAI's ChatGPT for efficient and accurate speech-to-text conversion. 14 15 https://youtu.be/9p-QOaxBOho 16 17 Click on the image above to watch the video presentation of the plugin. 18 19 20 Speech to Text for WPForms revolutionizes form filling by enabling users to input text into any WPForms form using their voice. This plugin leverages the cutting-edge Whisper voice recognition technology and OpenAI's ChatGPT for efficient and accurate speech-to-text conversion. All WPForms in the free version are fully supported, allowing users to complete entire forms with a single voice recording session. 21 15 22 16 23 **Key Features:** 17 24 - Utilizes OpenAI's Whisper and ChatGPT for state-of-the-art voice recognition and text conversion. 18 - Automatically populates text fields in WPForms with speech. 25 - Automatically populates all fields in WPForms with speech in a single recording session. 26 - Supports text fields, radio buttons, checkboxes, and dropdown lists. 27 - Advanced AI deduces information such as first and last names from your email address, streamlining form completion. 28 - Supports all WPForms free version. 19 29 - Prioritizes user privacy with a strict no data retention policy. 20 21 For more information and our terms of service, please visit [Terms of Service for Speech to Text for WPForms](https://boite0.com/terms-of-service-for-speech-to-text-for-wpforms/).22 30 23 31 == Installation == … … 29 37 30 38 == Usage == 31 Simply click the start recording button next to a form field, speak into your microphone, and watch as your words are converted to text and filled into the form.39 Simply click the start recording button, speak into your microphone to fill out all fields, then click the button again to stop the recording and automatically process the entire form. The plugin supports text fields, radio buttons, checkboxes, and dropdown lists, allowing you to complete forms quickly and efficiently. 32 40 33 41 == External Services == … … 39 47 40 48 == Frequently Asked Questions == 49 41 50 = How does Speech to Text for WPForms work? = 42 The plugin captures your voice as you speak into the microphone, sends the audio to OpenAI's Whisper for transcription, and then fills the transcribed text into the form field. 51 The plugin captures your voice as you speak into the microphone, sends the audio to OpenAI's Whisper for transcription, and then fills the transcribed text into the form fields. The plugin also supports radio buttons, checkboxes, and dropdown lists, enabling a comprehensive form-filling experience. 52 53 = Can I fill out multiple fields in one go? = 54 Yes, you can and need to do. Just click to start recording, speak to fill out the entire form, and click again to stop. The plugin will process all the fields at once, making form completion quick and easy. 55 56 = How does the AI enhance form filling? = 57 Our integration with OpenAI's ChatGPT allows the plugin to deduce additional information from your input. For example, if you provide your email as john.doe@example.com, the plugin can automatically fill in "John" for the first name and "Doe" for the last name, streamlining the form completion process. 43 58 44 59 = Is my data secure? = … … 46 61 47 62 = What types of fields can I fill using my voice? = 48 Currently, the plugin supports text fields, with plans to expand to other field types in future updates. 63 Currently, the plugin supports text fields, radio buttons, checkboxes, and dropdown lists. This comprehensive support allows you to complete entire forms quickly and easily. 64 65 = Do I need to activate the microphone every time I use the plugin? = 66 No, you only need to allow microphone access the first time you use the plugin. 67 68 = Which languages are supported? = 69 The plugin recognizes most major languages, including English, Spanish, French, German, Italian, Chinese, Japanese, and many more. As large language models (LLMs) improve, the number and quality of supported languages will continue to grow. 70 71 = Can the plugin make intelligent deductions? = 72 Yes, the plugin can make smart guesses. For example, if you say you live in New York but don’t specify the country, the plugin will deduce that you are in the USA and fill the form accordingly. Similarly, if the name Maria is mentioned, it will assume the user is female. 73 74 = How does the plugin handle noisy environments? = 75 The voice recognition remains highly accurate even in moderately noisy surroundings. 76 77 = Is it easy to install the plugin? = 78 Absolutely. Installation is as simple as clicking "Install" and "Activate". Once activated, the plugin works seamlessly on all WPForms. 79 80 = Do I need to configure anything after installation? = 81 No additional configuration is needed. The plugin works right out of the box. 82 83 = How can I uninstall the plugin? = 84 Simply deactivate the plugin to stop using it. Uninstalling it is as easy as deactivating it from the WordPress dashboard. 85 86 = How does the plugin handle form submission? = 87 After you finish speaking, you need to manually click "Submit" just like you would if you typed the information yourself. 88 89 = Can I correct mistakes while speaking? = 90 Yes, but all corrections must be made within the same voice input session. The AI will recognize the corrections and adjust accordingly during the transcription. 91 92 = How long does it take to process the voice input? = 93 Form completion usually happens in a few seconds, although it may take up to ten seconds in some cases. We are working to reduce this time in future updates. 94 95 = Can I fill in the form field by field using voice input? = 96 No, the form must be filled in one go. All fields are processed simultaneously. 97 98 = Can I modify a single field after submitting the voice input if the others are correct? = 99 No, any new voice input will overwrite all fields. For minor adjustments, we recommend manually editing the form fields. 100 101 = How does the plugin handle uncommon spellings? = 102 The plugin defaults to the most common spelling. If you mention a lesser-known place or an uncommon spelling variant, you may need to make manual adjustments. 103 104 = Why didn’t my form fill after I stopped speaking? = 105 You need to press the microphone button again to process the voice input and fill the form. 49 106 50 107 == Changelog == 108 = 1.1.0 = 109 - Added support for radio buttons, checkboxes, and dropdown lists. 110 - Enhanced AI capabilities to deduce first and last names from email addresses. 111 - Updated UI with tooltips for better user guidance. 112 51 113 = 1.0.0 = 52 114 - Initial release of the plugin. 53 115 54 116 == Upgrade Notice == 55 = 1. 0.0 =56 Enjoy the convenience of voice input for WPForms with our initial release.117 = 1.1.0 = 118 Enjoy the new features, including support for radio buttons, checkboxes, and dropdown lists, as well as enhanced AI for deducing names from email addresses. -
speech-to-text-for-wpforms/trunk/voxinput.js
r3116680 r3159744 1 2 1 'use strict'; 3 2 … … 7 6 let audioChunks = []; 8 7 let hasMicrophonePermission = false; 9 let currentStream; // Ajout pour garder une référence au flux actuel 8 let currentStream; 9 10 // Ajouter l'info-bulle au bouton micro avec des instructions améliorées 11 const microButton = document.getElementById("stt4wpforms_demarrer"); 12 microButton.title = "Click to start recording. Speak clearly, then click again to stop and process all fields at once."; 10 13 11 14 document.getElementById("stt4wpforms_demarrer").onclick = function () { … … 14 17 .then(stream => { 15 18 hasMicrophonePermission = true; 16 currentStream = stream; // Stocker le flux pour une utilisation ultérieure19 currentStream = stream; 17 20 startRecording(stream); 18 21 }); 19 } else { // Si l'utilisateur a déjà donné l'autorisation, redémarrer l'enregistrement sans demander à nouveau22 } else { 20 23 if (currentStream) { 21 24 startRecording(currentStream); 22 25 } else { 23 // Si currentStream est null, cela signifie que le flux a été fermé précédemment, donc on demande à nouveau24 26 navigator.mediaDevices.getUserMedia({ audio: true }) 25 27 .then(stream => { … … 30 32 } 31 33 }; 32 33 34 34 35 35 document.getElementById("stt4wpforms_arreter").onclick = function () { 36 36 mediaRecorder.stop(); 37 // Ajout pour désactiver le microphone38 37 if (currentStream) { 39 38 const tracks = currentStream.getTracks(); 40 39 tracks.forEach(track => track.stop()); 41 currentStream = null; // Réinitialiser currentStream après l'arrêt40 currentStream = null; 42 41 } 43 42 document.getElementById("stt4wpforms_arreter").disabled = true; 44 43 }; 45 44 46 function remplirFormulaireHtmlDepuisJson(formulaire, donnees) { 47 if (!donnees) {console.error("Aucune donnée fournie pour remplir le formulaire."); return;} 45 /* function remplirFormulaireHtmlDepuisJson(formulaire, donnees) { 46 if (!donnees) { 47 console.error("Aucune donnée fournie pour remplir le formulaire."); 48 return; 49 } 50 48 51 Object.entries(donnees).forEach(([cle, valeur]) => { 49 if (typeof valeur === 'object' && valeur !== null) { 52 if (cle.startsWith('wpforms[fields][8]') && typeof valeur === 'boolean') { 53 const index = cle.match(/\[(\d+)\]$/)[1]; 54 const checkboxName = `wpforms[fields][8][]`; 55 const checkboxes = formulaire.querySelectorAll(`input[name="${checkboxName}"]`); 56 if (checkboxes[index]) { 57 checkboxes[index].checked = valeur; 58 } 59 } else if (typeof valeur === 'object' && valeur !== null) { 50 60 Object.entries(valeur).forEach(([subKey, subValue]) => { 51 let input = formulaire.querySelector(`[name="${subKey}"]`); 52 if (input) {input.value = subValue;} 61 remplirChamp(formulaire, subKey, subValue); 53 62 }); 54 63 } else { 55 let input = formulaire.querySelector(`[name="${cle}"]`); 56 if (input) {input.value = valeur;} 64 remplirChamp(formulaire, cle, valeur); 57 65 } 58 66 }); 59 67 } 68 */ 69 70 function remplirFormulaireHtmlDepuisJson(formulaire, donnees) { 71 if (!donnees) { 72 console.error("Aucune donnée fournie pour remplir le formulaire."); 73 return; 74 } 75 76 Object.entries(donnees).forEach(([cle, valeur]) => { 77 const checkboxMatch = cle.match(/wpforms\[fields\]\[(\d+)\]\[(\d+)\]$/); 78 if (checkboxMatch && typeof valeur === 'boolean') { 79 const fieldId = checkboxMatch[1]; 80 const index = checkboxMatch[2]; 81 const checkboxName = `wpforms[fields][${fieldId}][]`; 82 const checkboxes = formulaire.querySelectorAll(`input[name="${checkboxName}"]`); 83 if (checkboxes[index]) { 84 checkboxes[index].checked = valeur; 85 } 86 } else if (typeof valeur === 'object' && valeur !== null) { 87 Object.entries(valeur).forEach(([subKey, subValue]) => { 88 remplirChamp(formulaire, subKey, subValue); 89 }); 90 } else { 91 remplirChamp(formulaire, cle, valeur); 92 } 93 }); 94 } 95 96 97 function remplirChamp(formulaire, cle, valeur) { 98 let inputs = formulaire.querySelectorAll(`[name="${cle}"]`); 99 if (inputs.length === 0) { 100 return; 101 } 102 103 let input = inputs[0]; 104 105 switch (input.type) { 106 case 'checkbox': 107 if (Array.isArray(valeur)) { 108 inputs.forEach(input => { 109 input.checked = valeur.includes(input.value); 110 }); 111 } else if (cle.endsWith('[]')) { 112 let checkboxValues = Array.isArray(valeur) ? valeur : [valeur]; 113 inputs.forEach(input => { 114 input.checked = checkboxValues.includes(input.value); 115 }); 116 } else { 117 input.checked = valeur === true || valeur === 'true' || valeur === '1'; 118 } 119 break; 120 case 'radio': 121 let radioInput = formulaire.querySelector(`[name="${cle}"][value="${valeur}"]`); 122 if (radioInput) radioInput.checked = true; 123 break; 124 case 'select-one': 125 case 'select-multiple': 126 if (Array.isArray(valeur)) { 127 Array.from(input.options).forEach(option => { 128 option.selected = valeur.includes(option.value); 129 }); 130 } else { 131 input.value = valeur; 132 } 133 break; 134 default: 135 input.value = valeur; 136 } 137 } 60 138 61 139 function startRecording(stream = null) { 62 if (!stream) {stream = currentStream;} // Utiliser currentStream si aucun stream n'est passé 140 if (!stream) { 141 stream = currentStream; 142 } 63 143 mediaRecorder = new MediaRecorder(stream); 64 mediaRecorder.ondataavailable = event => {audioChunks.push(event.data);}; 144 mediaRecorder.ondataavailable = event => { 145 audioChunks.push(event.data); 146 }; 65 147 mediaRecorder.onstop = function () { 66 148 const audioBlob = new Blob(audioChunks, { type: "audio/mp3" }); … … 71 153 donneesFormulaire.append("fichierAudio", audioBlob, "audio.mp3"); 72 154 donneesFormulaire.append("html", codeHTML); 73 fetch('https://boite0.com:8080/voxInput', {method: 'POST', body: donneesFormulaire}) // URL mise à jour pour l'envoi des données 74 // fetch('http://127.0.0.1:1880/voxInput', {method: 'POST', body: donneesFormulaire}) 155 fetch('https://boite0.com:8080/voxInputDev', { method: 'POST', body: donneesFormulaire }) 75 156 .then(reponse => { 76 if (!reponse.ok) {throw new Error('La requête a échoué avec le statut ' + reponse.status);} 157 if (!reponse.ok) { 158 throw new Error('La requête a échoué avec le statut ' + reponse.status); 159 } 77 160 return reponse.json(); 78 161 }) … … 80 163 remplirFormulaireHtmlDepuisJson(formulaire, donnees); 81 164 }) 82 .catch(erreur => {console.error('Erreur lors de la récupération des données:', erreur);}); 83 } else {console.log('Formulaire WPForms non trouvé');} 165 .catch(erreur => { 166 console.error('Erreur lors de la récupération des données:', erreur); 167 }); 168 } else { 169 console.log('Formulaire WPForms non trouvé'); 170 } 84 171 }; 85 172 audioChunks = []; -
speech-to-text-for-wpforms/trunk/voxinput.php
r3116680 r3159744 6 6 Plugin Name: Speech To Text for Wpforms 7 7 Description: Filling out Wpforms-lite forms by voice. 8 Version: 1. 0.08 Version: 1.1.0 9 9 Requires at least: 5.5 10 Tested up to: 6. 510 Tested up to: 6.6 11 11 Stable tag: 1.0.0 12 12 Requires PHP: 7.0
Note: See TracChangeset
for help on using the changeset viewer.