Interface orientée-objet Dictation (reconnaissance vocale).

Partager vos scripts et fonctions intéressantes
A_AhkUser
Posts: 1076
Joined: 06 Mar 2017, 16:18
GitHub: AAhkUser
Location: France

Interface orientée-objet Dictation (reconnaissance vocale).

06 Jan 2018, 20:00

Une interface orientée-objet qui permet d'intégrer et de mobiliser la reconnaissance vocale - reconnaît le français, l'espagnol, l'anglais et le russe, entre autres - comme ressource dans un script AutoHotkey.
Le script ne fonctionnera qu'avec chrome. La communication avec chrome est rendue possible par le déploiement d'une extension, élaborée de telle sorte qu'elle parle un langage que le script est en mesure de reconnaître et d'interpréter pour y répondre de manière appropriée. Une fois l'extension déployée et avant la première utilisation du script, il faudra veiller à spécifier son ID tout en haut de la classe Dictation:

[attachment=0]Dictation.png[/attachment]

@Class.Dictation.ahk

Code: Select all

Class Dictation {

	; ==========================================
	static ID := "" ; <<<< Placez ici l'ID de l'extension; par example: "ejjjdhlcmnppdkjfgmopeiobcbhapppl"
	; ==========================================

		, url := "https://dictation.io/speech"

		hideChromeInstance := false
		, recognitionLanguage := ""
		, recognizing := false
		, iteratorPeriod := 400
		, interimResultTimeout := 14
		, lastInterimResultElapsedTime := 0
		, lastInterimResult := ""
		, onInterimResultFunc := this.updateInterimResults
                , onResultFunc := this.saveToClipboard
; ...
Deux évènements - onInterimResult et onResult - sont susceptibles d'appeler des fonctions callback.

Dictation-Interface (contient un exemple commenté).


Dernière mise à jour testée sur Chrome Version 69.0.3497.81 (Build officiel) (64 bits) [ahk v1.1.29.01].
Attachments
Dictation.png
Dictation.png (9.48 KiB) Viewed 869 times
hasantr
Posts: 156
Joined: 05 Apr 2016, 14:18

Re: Interface orientée-objet Dictation (reconnaissance vocale).

14 Jul 2019, 06:52

This is a great work. This works very well. You're very successful, man. :) :bravo:

Can you make an example that will send text to a place where the mouse cursor is checked?

I don't want the browser extension window to appear in person. Is there any way to hide it?
A_AhkUser
Posts: 1076
Joined: 06 Mar 2017, 16:18
GitHub: AAhkUser
Location: France

Re: Interface orientée-objet Dictation (reconnaissance vocale).

20 Jul 2019, 10:43

Hi hasantr,

Thanks for your feedback hasantr, much appreciated.
hasantr wrote:
14 Jul 2019, 06:52
Can you make an example that will send text to a place where the mouse cursor is checked?
Off course :D: I just added a commented exemple. ;) In it, the final recognition result is sent to the input-capable control where the caret lies, if applicable.
hasantr wrote:
14 Jul 2019, 06:52
I don't want the browser extension window to appear in person. Is there any way to hide it?
Yes! You simply need to set - as in the added exemple - the base property hideChromeInstance to true - that is:

Code: Select all

Dictation.hideChromeInstance := true
Let me know if you have any further questions about this script or need more exemples.
Cheers
hasantr
Posts: 156
Joined: 05 Apr 2016, 14:18

Re: Interface orientée-objet Dictation (reconnaissance vocale).

Yesterday, 15:20

Thank you so much. It works great in the new example. There is probably no other alternative that succeeds in this regard for free.
A_AhkUser wrote:
20 Jul 2019, 10:43
Hi hasantr,
Off course :D: I just added a commented exemple. ;) In it, the final recognition result is sent to the input-capable control where the caret lies, if applicable.
There is such a problem. When the plugin window does not appear, we get rid of the crowd. Unfortunately, sometimes the plug-in is not closed and continues to listen to conversations for a long time. I want to make sure that my voice will no longer record when the recording time is over. Maybe a "Rec" text can be put on the screen. When I click on Rec, I can be sure that I definitely stopped recording.
I was surprised to see some of my private speeches as articles. :) Is the technology actually annoying? :)

Return to “Scripts et Fonctions”

Who is online

Users browsing this forum: No registered users and 0 guests