Electron microphone

Hi, i’m trying to use the microphone with my electron project in order to create an assistant with my game ( i already have too many keys mapped )

I tried to make a voice recognition with this : https://developer.mozilla.org/fr/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
And it work only when it is contained in a simple html/js file.

when i try to use the speech recognition with electron the mic do not seems to work, and i don’t know why… can someone tell me what i am missing ?

my html file:


	var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
	var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList
	var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent

	var recognition = new SpeechRecognition();
	var speechRecognitionList = new SpeechGrammarList();
	recognition.grammars = speechRecognitionList;
	recognition.continuous = false;
	recognition.lang = 'fr-FR';
	recognition.interimResults = false;
	recognition.maxAlternatives = 1;

	function repeat(){
		recognition.onresult = function(event){

<body >
	<input onclick="repeat();"type="button" >


Are you trying to run this code in the main process? If so, it won’t work. This API is linked to the browser. It must be in/loaded from an HTML file.

This code is linked with my html file <script>require('myJsFile.js');</script>
But if you have any framework or something else to use the voice recognition i’m very glad to learn something new.