Plugin Directory

Changeset 3159744


Ignore:
Timestamp:
09/30/2024 10:19:44 AM (18 months ago)
Author:
laboite0
Message:

Released version 1.1.0: Added support for radio buttons, checkboxes, dropdown lists, and improved AI for deducing names from email addresses.

Location:
speech-to-text-for-wpforms
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • speech-to-text-for-wpforms/trunk/README.txt

    r3116680 r3159744  
    33Tags: wpforms, form, voice recognition, voice input, whisper, stt, tts, ai
    44Requires at least: 5.5
    5 Tested up to: 6.5.3
    6 Stable tag: 1.0.0
     5Tested up to: 6.6.1
     6Stable tag: 1.1.0
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1212
    1313== 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
     15https://youtu.be/9p-QOaxBOho
     16
     17Click on the image above to watch the video presentation of the plugin.
     18
     19
     20Speech 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
    1522
    1623**Key Features:**
    1724- 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.
    1929- 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/).
    2230
    2331== Installation ==
     
    2937
    3038== 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.
     39Simply 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.
    3240
    3341== External Services ==
     
    3947
    4048== Frequently Asked Questions ==
     49
    4150= 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.
     51The 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? =
     54Yes, 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? =
     57Our 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.
    4358
    4459= Is my data secure? =
     
    4661
    4762= 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.
     63Currently, 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? =
     66No, you only need to allow microphone access the first time you use the plugin.
     67
     68= Which languages are supported? =
     69The 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? =
     72Yes, 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? =
     75The voice recognition remains highly accurate even in moderately noisy surroundings.
     76
     77= Is it easy to install the plugin? =
     78Absolutely. 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? =
     81No additional configuration is needed. The plugin works right out of the box.
     82
     83= How can I uninstall the plugin? =
     84Simply 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? =
     87After 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? =
     90Yes, 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? =
     93Form 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? =
     96No, 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? =
     99No, 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? =
     102The 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? =
     105You need to press the microphone button again to process the voice input and fill the form.
    49106
    50107== 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
    51113= 1.0.0 =
    52114- Initial release of the plugin.
    53115
    54116== Upgrade Notice ==
    55 = 1.0.0 =
    56 Enjoy the convenience of voice input for WPForms with our initial release.
     117= 1.1.0 =
     118Enjoy 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 
    21'use strict';
    32
     
    76    let audioChunks = [];
    87    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.";
    1013
    1114    document.getElementById("stt4wpforms_demarrer").onclick = function () {
     
    1417            .then(stream => {
    1518                hasMicrophonePermission = true;
    16                 currentStream = stream; // Stocker le flux pour une utilisation ultérieure
     19                currentStream = stream;
    1720                startRecording(stream);
    1821            });
    19         } else {             // Si l'utilisateur a déjà donné l'autorisation, redémarrer l'enregistrement sans demander à nouveau
     22        } else {
    2023            if (currentStream) {
    2124                startRecording(currentStream);
    2225            } else {
    23                 // Si currentStream est null, cela signifie que le flux a été fermé précédemment, donc on demande à nouveau
    2426                navigator.mediaDevices.getUserMedia({ audio: true })
    2527                .then(stream => {
     
    3032        }
    3133    };
    32    
    33 
    3434
    3535    document.getElementById("stt4wpforms_arreter").onclick = function () {
    3636        mediaRecorder.stop();
    37         // Ajout pour désactiver le microphone
    3837        if (currentStream) {
    3938            const tracks = currentStream.getTracks();
    4039            tracks.forEach(track => track.stop());
    41             currentStream = null; // Réinitialiser currentStream après l'arrêt
     40            currentStream = null;
    4241        }
    4342        document.getElementById("stt4wpforms_arreter").disabled = true;
    4443    };
    4544
    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
    4851        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) {
    5060                Object.entries(valeur).forEach(([subKey, subValue]) => {
    51                     let input = formulaire.querySelector(`[name="${subKey}"]`);
    52                     if (input) {input.value = subValue;}
     61                    remplirChamp(formulaire, subKey, subValue);
    5362                });
    5463            } else {
    55                 let input = formulaire.querySelector(`[name="${cle}"]`);
    56                 if (input) {input.value = valeur;}
     64                remplirChamp(formulaire, cle, valeur);
    5765            }
    5866        });
    5967    }
     68*/
     69
     70function 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    }
    60138
    61139    function startRecording(stream = null) {
    62         if (!stream) {stream = currentStream;} // Utiliser currentStream si aucun stream n'est passé
     140        if (!stream) {
     141            stream = currentStream;
     142        }
    63143        mediaRecorder = new MediaRecorder(stream);
    64         mediaRecorder.ondataavailable = event => {audioChunks.push(event.data);};
     144        mediaRecorder.ondataavailable = event => {
     145            audioChunks.push(event.data);
     146        };
    65147        mediaRecorder.onstop = function () {
    66148            const audioBlob = new Blob(audioChunks, { type: "audio/mp3" });
     
    71153                donneesFormulaire.append("fichierAudio", audioBlob, "audio.mp3");
    72154                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 })
    75156                .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                    }
    77160                    return reponse.json();
    78161                })
     
    80163                    remplirFormulaireHtmlDepuisJson(formulaire, donnees);
    81164                })
    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            }
    84171        };
    85172        audioChunks = [];
  • speech-to-text-for-wpforms/trunk/voxinput.php

    r3116680 r3159744  
    66Plugin Name: Speech To Text for Wpforms
    77Description: Filling out Wpforms-lite forms by voice.
    8 Version: 1.0.0
     8Version: 1.1.0
    99Requires at least: 5.5
    10 Tested up to: 6.5
     10Tested up to: 6.6
    1111Stable tag: 1.0.0
    1212Requires PHP: 7.0
Note: See TracChangeset for help on using the changeset viewer.