UNPKG

dragon-tempos

Version:

24 lines (19 loc) 800 B
const { app, BrowserWindow } = require('electron'); const ProcesoVoz = require('child_process').spawn; var voz = function(){ this._proceso = null; } voz.prototype.hablar = function(texto){ this._proceso = ProcesoVoz('powershell', [ '-c', '$speechy = New-Object -ComObject SAPI.SPVoice; $speechy.Speak("'+texto+'"); $speechy.Dispose()' ]); } app.on('ready',function(){ console.log("Esta listo."); let ventanaPrincipal = new BrowserWindow(); var voz1= new voz(); voz1.hablar("Hola, Bienvenido o bienvenida. Soy un asistente virtual. Te ayudare a organizar la administración del area de biblioteca, mucho gusto."); ventanaPrincipal.loadURL(`file://${__dirname}/index.html?data=cosas`); ventanaPrincipal.loadURL(`https://www.youtube.com/watch?v=3SDBTVcBUVs`); })