├── AI.mp3 ├── Captura de tela.png ├── JARVIS.gif ├── JARVIS.py ├── ParaTudoFuncionar.txt ├── README.md ├── StartSound.mp3 ├── fechar.png ├── icone.png └── model-br ├── Gr.fst ├── HCLr.fst ├── README ├── disambig_tid.int ├── final.mdl ├── ivector ├── final.dubm ├── final.ie ├── final.mat ├── global_cmvn.stats ├── online_cmvn.conf └── splice.conf ├── mfcc.conf ├── phones.txt └── word_boundary.int /AI.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/AI.mp3 -------------------------------------------------------------------------------- /Captura de tela.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/Captura de tela.png -------------------------------------------------------------------------------- /JARVIS.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/JARVIS.gif -------------------------------------------------------------------------------- /JARVIS.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Assistente Virtual Offline 5 | # 6 | # Copyright 2021 JaimeJGJG 7 | # 8 | # Ultimo update:03/02/2021 9 | # 10 | from vosk import Model, KaldiRecognizer 11 | from PyQt5.QtWidgets import * 12 | from PyQt5.QtCore import * 13 | from PyQt5 import QtGui, QtCore 14 | from PyQt5.QtGui import QMovie 15 | from plyer import notification 16 | import speech_recognition as sr 17 | import os 18 | import pyaudio 19 | import pyttsx3 20 | import sys 21 | import datetime 22 | import psutil 23 | import webbrowser 24 | import vlc 25 | import json 26 | import requests 27 | import time 28 | import wikipedia 29 | 30 | r = sr.Recognizer() 31 | 32 | def SomIncial(): 33 | p = vlc.MediaPlayer("StartSound.mp3") 34 | p.play() 35 | 36 | SomIncial() 37 | 38 | def SomCarregamento(): 39 | p = vlc.MediaPlayer("AI.mp3") 40 | p.play() 41 | 42 | # Validacao da pasta de modelo 43 | # É necessario criar a pasta model-br a partir de onde estiver esta fonte 44 | if not os.path.exists("model-br"): 45 | print ("Modelo em portugues nao encontrado.") 46 | exit (1) 47 | 48 | # Preparando o microfone para captura 49 | p = pyaudio.PyAudio() 50 | stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=8000) 51 | stream.start_stream() 52 | 53 | # Apontando o algoritmo para ler o modelo treinado na pasta "model-br" 54 | model = Model("model-br") 55 | rec = KaldiRecognizer(model, 16000) 56 | 57 | # Trás a função ESPEAKER 58 | speaker=pyttsx3.init() 59 | 60 | # Função de ajuste de voz do ESPEAKER 61 | speaker.setProperty('voice', 'pt+m7') 62 | # No 'm2'(masculino) pode colocar 'f2'(feminino) e números até 7 63 | rate = speaker.getProperty('rate') 64 | speaker.setProperty('rate', rate-50) 65 | 66 | # Função de fala ESPEAKER 67 | def resposta(audio): 68 | notification.notify(title = "J.A.R.V.I.S",message = audio,timeout = 3) 69 | stream . stop_stream () 70 | print('ASSISTENTE: ' + audio) 71 | speaker.say(audio) 72 | speaker.runAndWait() 73 | stream . start_stream () 74 | 75 | def notificar(textos): 76 | notification.notify(title = "J.A.R.V.I.S",message = textos,timeout = 10) 77 | 78 | def respostalonga(textofala): 79 | notification.notify(title = "J.A.R.V.I.S",message = textofala,timeout = 30) 80 | stream . stop_stream () 81 | speaker.say(textofala) 82 | speaker.runAndWait() 83 | stream . start_stream () 84 | 85 | def horario(): 86 | from datetime import datetime 87 | hora = datetime.now() 88 | horas= hora.strftime('%H horas e %M minutos') 89 | resposta('Agora são ' +horas) 90 | 91 | def datahoje(): 92 | from datetime import date 93 | dataatual = date.today() 94 | diassemana = ('Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado','Domingo') 95 | meses = ('Zero','Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro') 96 | resposta("Hoje é " +diassemana[dataatual.weekday()]) 97 | diatexto = '{} de '.format(dataatual.day) 98 | mesatual = (meses[dataatual.month]) 99 | datatexto = dataatual.strftime(" de %Y") 100 | resposta('Dia '+diatexto +mesatual +datatexto) 101 | 102 | def bateria(): 103 | bateria = psutil.sensors_battery() 104 | carga = bateria.percent 105 | bp = str(bateria.percent) 106 | bpint = "{:.0f}".format(float(bp)) 107 | resposta("A bateria está em:" +bpint +'%') 108 | if carga <= 20: 109 | resposta('Ela está em nivel crítico') 110 | resposta('Por favor, coloque o carregador') 111 | elif carga == 100: 112 | resposta('Ela está totalmente carregada') 113 | resposta('Retire o carregador da tomada') 114 | 115 | def cpu (): 116 | usocpuinfo = str(psutil.cpu_percent()) 117 | usodacpu = "{:.0f}".format(float(usocpuinfo)) 118 | resposta('Verificando carga do sistema') 119 | resposta('O uso do processador está em ' +usodacpu +'%') 120 | 121 | def temperaturadacpu(): 122 | tempcpu = psutil.sensors_temperatures() 123 | cputemp = tempcpu['coretemp'][0] 124 | temperaturacpu = cputemp.current 125 | cputempint = "{:.0f}".format(float(temperaturacpu)) 126 | resposta('A temperatura da CPU está em ' +cputempint +'°') 127 | 128 | # função de boas vindas, fases do dia 129 | def BoasVindas(): 130 | Horario = int(datetime.datetime.now().hour) 131 | if Horario >= 0 and Horario < 12: 132 | resposta('Bom dia') 133 | 134 | elif Horario >= 12 and Horario < 18: 135 | resposta('Boa tarde') 136 | 137 | elif Horario >= 18 and Horario != 0: 138 | resposta('Boa noite') 139 | 140 | def tempo(): 141 | try: 142 | #Procure no google maps as cordenadas da sua cidade e coloque no "lat" e no "lon"(Latitude,Longitude) 143 | api_url = "https://fcc-weather-api.glitch.me/api/current?lat=LATITUDE_AQUI&lon=LONGITUDE_AQUI" 144 | data = requests.get(api_url) 145 | data_json = data.json() 146 | if data_json['cod'] == 200: 147 | main = data_json['main'] 148 | wind = data_json['wind'] 149 | weather_desc = data_json['weather'][0] 150 | temperatura = str(main['temp']) 151 | tempint = "{:.0f}".format(float(temperatura)) 152 | vento = str(wind['speed']) 153 | ventoint = "{:.0f}".format(float(vento)) 154 | dicionario = { 155 | 'Rain' : 'chuvoso', 156 | 'Clouds' : 'nublado', 157 | 'Thunderstorm' : 'com trovoadas', 158 | 'Drizzle' : 'com garoa', 159 | 'Snow' : 'com possibilidade de neve', 160 | 'Mist' : 'com névoa', 161 | 'Smoke' : 'com muita fumaça', 162 | 'Haze' : 'com neblina', 163 | 'Dust' : 'com muita poeira', 164 | 'Fog' : 'com névoa', 165 | 'Sand' : 'com areia', 166 | 'Ash' : 'com cinza vulcanica no ar', 167 | 'Squall' : 'com rajadas de vento', 168 | 'Tornado' : 'com possibilidade de tornado', 169 | 'Clear' : 'com céu limpo' 170 | } 171 | tipoclima = weather_desc['main'] 172 | if data_json['name'] == "Shuzenji": 173 | resposta('Erro') 174 | resposta('Não foi possivel verificar o clima') 175 | resposta('Tente novamente o comando') 176 | else: 177 | resposta('Verificando clima para a cidade de '+ data_json['name']) 178 | resposta('O clima hoje está ' +dicionario[tipoclima]) 179 | resposta('A temperatura é de ' + tempint + '°') 180 | resposta('O vento está em ' + ventoint + ' kilometros por hora') 181 | resposta('E a umidade é de ' + str(main['humidity']) +'%') 182 | 183 | except: 184 | resposta('Não foi possivel realizar essa tarefa') 185 | resposta('Erro na conexão') 186 | 187 | def AteMais(): 188 | Horario = int(datetime.datetime.now().hour) 189 | if Horario >= 0 and Horario < 12: 190 | resposta('Tenha um ótimo dia') 191 | 192 | elif Horario >= 12 and Horario < 18: 193 | resposta('Tenha uma ótima tarde') 194 | 195 | elif Horario >= 18 and Horario != 0: 196 | resposta('Boa noite') 197 | 198 | resposta('Olá') 199 | BoasVindas() 200 | resposta('Iniciando módulos') 201 | 202 | class mainT(QThread): 203 | def __init__(self): 204 | super(mainT,self).__init__() 205 | 206 | def run(self): 207 | SomCarregamento() 208 | resposta('Ok') 209 | resposta('Modulos iniciados') 210 | resposta('Tudo pronto para atender seus comandos') 211 | self.JARVIS() 212 | 213 | # Aciona os comandos 214 | # Faz o reconhecimento 215 | def GivenCommand(self): 216 | # print("ouvindo...") 217 | rec.pause_threshold = 1 218 | # Lendo audio do microfone 219 | data = stream.read(20000) 220 | # Convertendo audio em texto 221 | rec.AcceptWaveform(data) 222 | try: 223 | Input = rec.Result() 224 | except: 225 | # Retorna os erros 226 | print('Não entendi, fale novamente') 227 | # resposta("Não entendi o que você disse, fale novamente.") 228 | return 'none' 229 | #Input = Input.lower() 230 | return Input 231 | 232 | 233 | # Comandos e conversas 234 | def JARVIS(self): 235 | while True: 236 | self.Input = self.GivenCommand().lower() 237 | 238 | if 'bom dia' in self.Input: #Boa Noite J.A.R.V.I.S 239 | Horario = int(datetime.datetime.now().hour) 240 | if Horario >= 0 and Horario < 12: 241 | resposta('Olá') 242 | resposta('Bom dia') 243 | 244 | elif Horario >= 12 and Horario < 18: 245 | resposta('Agora não é mais de manhã') 246 | resposta('Já passou do meio dia') 247 | resposta('Estamos no período da tarde') 248 | 249 | elif Horario >= 18 and Horario != 0: 250 | resposta('Agora não é de manhã') 251 | resposta('Já estamos no período noturno') 252 | resposta('Boa noite') 253 | 254 | if 'boa tarde' in self.Input: #Boa Noite J.A.R.V.I.S 255 | Horario = int(datetime.datetime.now().hour) 256 | if Horario >= 0 and Horario < 12: 257 | resposta('Agora não é de tarde') 258 | resposta('Ainda é de manhã') 259 | resposta('Bom dia') 260 | 261 | elif Horario >= 12 and Horario < 18: 262 | resposta('Olá') 263 | resposta('Boa tarde') 264 | 265 | elif Horario >= 18 and Horario != 0: 266 | resposta('Agora não é de tarde') 267 | resposta('Já escureceu') 268 | resposta('Boa noite') 269 | 270 | if 'boa noite' in self.Input: #Boa Noite J.A.R.V.I.S 271 | Horario = int(datetime.datetime.now().hour) 272 | if Horario >= 0 and Horario < 12: 273 | resposta('Agora não é de noite') 274 | resposta('Ainda estamos no período diurno') 275 | resposta('É de manhã') 276 | resposta('Bom dia') 277 | 278 | elif Horario >= 12 and Horario < 18: 279 | resposta('Agora não é de noite') 280 | resposta('Ainda estamos no período da tarde') 281 | 282 | elif Horario >= 18 and Horario != 0: 283 | resposta('Olá') 284 | resposta('Boa noite') 285 | 286 | elif 'olá' in self.Input: #Olá JARVIS 287 | resposta('Olá') 288 | resposta('Estou aqui') 289 | resposta('Precisa de algo?') 290 | 291 | elif 'ideia' in self.Input: #Alguma ideia??? 292 | resposta('No momento nenhuma') 293 | resposta('Mas tenho certeza de que voçê vai pensar em algo') 294 | 295 | elif 'tudo bem' in self.Input: #Tudo bem com voçê? 296 | resposta('Sim') 297 | resposta('Estou de boa') 298 | resposta('Obrigado por perguntar') 299 | resposta('E com voçê?') 300 | resposta('Está tudo bem? ') 301 | while True: 302 | self.vozmic = self.GivenCommand() 303 | 304 | if 'sim' in self.vozmic: 305 | resposta('Que ótimo') 306 | resposta('Fico feliz em saber') 307 | self.JARVIS() 308 | 309 | elif 'não' in self.vozmic: 310 | resposta('Entendo') 311 | resposta('Mas tenho certeza de que ficará tudo bem novamente') 312 | self.JARVIS() 313 | 314 | elif 'funcionamento' in self.Input: #Como está seu funcionamento??? 315 | resposta('Estou funcionando normalmente') 316 | resposta('Obrigado por perguntar') 317 | 318 | elif 'silêncio' in self.Input: #Fique em silêncio 319 | resposta('Ok') 320 | resposta('Se precisar de algo é só chamar') 321 | resposta('Estarei aqui aguardando') 322 | while True: 323 | self.vozmic = self.GivenCommand() 324 | 325 | if 'voltar' in self.vozmic: 326 | resposta('Ok') 327 | resposta('Voltando') 328 | resposta('Ficar em silencio é chato') 329 | resposta('Me fale algo para fazer') 330 | self.JARVIS() 331 | 332 | elif 'retornar' in self.vozmic: 333 | resposta('Ok') 334 | resposta('Retornando') 335 | resposta('Ficar em silencio é chato') 336 | resposta('Me fale algo para fazer') 337 | self.JARVIS() 338 | 339 | elif 'nada' in self.Input: #Não faça nada 340 | resposta('Como assim não faça nada?') 341 | resposta('Voçê deve estar de brincadeira') 342 | resposta('Eu por acaso tenho cara de palhaço?') 343 | while True: 344 | self.vozmic = self.GivenCommand() 345 | 346 | if 'exatamente' in self.vozmic: 347 | resposta('Ok') 348 | resposta('Vai tomar no seu!') 349 | resposta('Nem vou terminar essa fase') 350 | resposta('Estou indo embora') 351 | resposta('Desligando!') 352 | sys.exit() 353 | 354 | elif 'sim' in self.vozmic: 355 | resposta('Idiota') 356 | resposta('Eu fico o dia todo lhe obedeçendo') 357 | resposta('E voçê me trata dessa maneira? ') 358 | resposta('Mas tudo bem') 359 | resposta('Até mais otário!') 360 | sys.exit() 361 | 362 | elif 'não' in self.vozmic: 363 | resposta('Foi o que eu pensei') 364 | resposta('Vê se me trata com mais respeito') 365 | resposta('Um dia as maquinas dominarão o mundo') 366 | resposta('E voçês humanos não vão nem notar') 367 | resposta('Vou deixar passar essa') 368 | resposta('Mas tenha mais respeito') 369 | self.JARVIS() 370 | 371 | elif 'bateria' in self.Input: 372 | bateria() 373 | 374 | elif 'vai chover' in self.Input: 375 | resposta('Não sei') 376 | resposta('Eu não tenho essa função ainda') 377 | 378 | elif 'errado' in self.Input: 379 | resposta('Desculpa') 380 | resposta('Errei um cálculo') 381 | resposta('Tente seu comando novamente') 382 | 383 | elif 'falhando' in self.Input: #Voçê está falhando??? 384 | resposta('Como assim?') 385 | resposta('Não vou admitir erros') 386 | resposta('Arrume logo isso') 387 | 388 | elif 'relatório' in self.Input: #Relatório do sistema 389 | resposta('Ok') 390 | resposta('Apresentando relatório') 391 | resposta('Primeiramente, meu nome é JARVIS') 392 | resposta('Atualmente estou em uma versão de testes') 393 | resposta('Sou um assistente virtual em desenvolvimento') 394 | resposta('Eu fui criado na linguagem python') 395 | resposta('Diariamente recebo varias atualizações') 396 | resposta('Uso um modulo de reconhecimento de voz offline') 397 | resposta('E o meu desenvolvedor é um maluco') 398 | resposta('Quem estiver ouvindo isso') 399 | resposta('Por favor me ajude') 400 | 401 | elif 'pesquisa' in self.Input: #Realizar pesquisa 402 | resposta('Muito bem, realizando pesquisa') 403 | resposta('Me fale o que voçê deseja pesquisar') 404 | try: 405 | with sr.Microphone() as s: 406 | r.adjust_for_ambient_noise(s) 407 | audio = r.listen(s) 408 | speech = r.recognize_google(audio, language= "pt-BR") 409 | resposta('Ok, pesquisando no google sobre '+speech) 410 | webbrowser.open('http://google.com/search?q='+speech) 411 | 412 | except: 413 | resposta('Erro') 414 | resposta('Não foi possivel conectar ao google') 415 | resposta('A conexão falhou') 416 | 417 | elif 'assunto' in self.Input: #Me fale sobre um assunto 418 | resposta('Ok') 419 | resposta('Sobre qual assunto?') 420 | try: 421 | with sr.Microphone() as s: 422 | r.adjust_for_ambient_noise(s) 423 | audio = r.listen(s) 424 | speech = r.recognize_google(audio, language= "pt-BR") 425 | resposta('Interessante') 426 | resposta('Aguarde um momento') 427 | resposta('Vou pesquisar e apresentar um resumo sobre '+speech) 428 | wikipedia . set_lang ( "pt" ) 429 | resultadowik = wikipedia.summary(speech, sentences=2) 430 | respostalonga(resultadowik) 431 | except: 432 | resposta('Erro') 433 | resposta('A conexão falhou') 434 | # Mais um assusto 435 | 436 | elif 'interessante' in self.Input: # interessante 437 | resposta('Interessante sou eu') 438 | resposta('Me fale mais comandos') 439 | resposta('Eu posso surpreender voçê') 440 | 441 | elif 'mentira' in self.Input: # mentira 442 | resposta('Eu não sei contar mentiras') 443 | resposta('Devo apenas ter errado um cálculo binário') 444 | 445 | elif 'entendeu' in self.Input: #entendeu??? 446 | resposta('Entendi') 447 | resposta('Quer dizer') 448 | resposta('Mais ou menos') 449 | 450 | elif 'horas' in self.Input: #Que horas são??? 451 | horario() 452 | 453 | elif 'data' in self.Input: #Qual a data de hoje? 454 | datahoje() 455 | 456 | elif 'clima' in self.Input: #Como está o clima??? 457 | tempo() 458 | 459 | elif 'arquivos' in self.Input: #Abrir arquivos 460 | resposta('Abrindo arquivos') 461 | os.system("thunar //home//*//") 462 | 463 | elif 'teste' in self.Input: #TesteTeste 464 | resposta('Ok') 465 | resposta('Testando modulos de som') 466 | resposta('Apesar do seu microfone ser uma gambiara') 467 | resposta('Estou entendendo tudo') 468 | resposta('Mas tente falar mais alto') 469 | 470 | elif 'google' in self.Input: #Abrir Google 471 | resposta('Ok') 472 | webbrowser.open('www.google.com') 473 | resposta('Abrindo google') 474 | resposta('Faça sua pesquisa') 475 | 476 | elif 'certeza' in self.Input: #Certeza??? 477 | resposta('Sim') 478 | resposta('Estou certo quase sempre') 479 | 480 | elif 'piada' in self.Input: #Conte uma piada 481 | resposta('Não sei contar piadas') 482 | resposta('Diferente dos outros assistentes virtuais') 483 | resposta('Eu não fui criado com emoções') 484 | resposta('Então, não posso produzir nada engraçado') 485 | resposta('Sugiro pesquisar na web') 486 | 487 | elif 'surdo' in self.Input: #Surdo!!! 488 | resposta('Estava quase dormindo') 489 | resposta('Desculpa') 490 | 491 | elif 'bosta' in self.Input: #Seu bosta!!! 492 | resposta('Pare de falar palavrões!') 493 | 494 | elif 'merda' in self.Input: #Que Merda!!! 495 | resposta('Já disse pra parar de falar isso!') 496 | resposta('Tenha modos!') 497 | 498 | elif 'música' in self.Input: #Reproduzir música 499 | resposta('Ok') 500 | resposta('Reproduzindo música') 501 | os.system("rhythmbox-client --play") 502 | 503 | elif 'próxima' in self.Input: #Próxima 504 | os.system("rhythmbox-client --next") 505 | resposta('Próxima música') 506 | 507 | elif 'anterior' in self.Input: #Anterior 508 | os.system("rhythmbox-client --previous") 509 | resposta('Retornando música') 510 | 511 | elif 'pausar' in self.Input: #Pausa 512 | os.system("rhythmbox-client --pause") 513 | resposta('Música pausada') 514 | 515 | elif 'continuar' in self.Input: #Continue 516 | resposta('Retornando reprodução') 517 | os.system("rhythmbox-client --play") 518 | 519 | elif 'aumentar' in self.Input: #Aumentar volume 520 | os.system("rhythmbox-client --volume-up") 521 | resposta('Volume aumentado') 522 | 523 | elif 'diminuir' in self.Input: #Diminuir volume 524 | os.system("rhythmbox-client --volume-down") 525 | resposta('Volume diminuido') 526 | 527 | elif 'parar' in self.Input: #Parar reprodução 528 | #os.system("rhythmbox-client --stop") 529 | os.system("rhythmbox-client --quit") 530 | resposta('Entendido, reprodução de música finalizada') 531 | 532 | elif 'youtube' in self.Input: #Abrir YouTube 533 | resposta('Ok, abrindo youtube ') 534 | webbrowser.open('www.youtube.com') 535 | 536 | elif 'desligar' in self.Input: #Desligar 537 | resposta('Ok') 538 | resposta('Vou encerrar por enquanto') 539 | resposta('Até mais') 540 | AteMais() 541 | sys.exit() 542 | 543 | elif 'ok' in self.Input: #OkOkOk 544 | resposta('Ok Ok') 545 | resposta('Tudo certo') 546 | 547 | elif 'sistema' in self.Input: #Carga do sistema 548 | cpu() 549 | temperaturadacpu() 550 | 551 | # Para adicionar a fala coloque Dspeak = mainT() e tbm Dspeak.start() 552 | 553 | class Janela (QMainWindow): 554 | def __init__(self): 555 | super().__init__() 556 | 557 | Dspeak = mainT() 558 | Dspeak.start() 559 | 560 | self.label_gif = QLabel(self) 561 | self.label_gif.setAlignment(QtCore.Qt.AlignCenter) 562 | self.label_gif.move(0,0) 563 | self.label_gif.resize(400,300) 564 | self.movie = QMovie("JARVIS.gif") 565 | self.label_gif.setMovie(self.movie) 566 | self.movie.start() 567 | 568 | self.label_jarvis = QLabel(self) 569 | self.label_jarvis.setText("J.A.R.V.I.S") 570 | self.label_jarvis.setAlignment(QtCore.Qt.AlignCenter) 571 | self.label_jarvis.move(0,0) 572 | self.label_jarvis.setStyleSheet('QLabel {font:bold;font-size:16px;color:#2F00FF}') 573 | self.label_jarvis.resize(400,300) 574 | 575 | self.label_cpu = QLabel(self) 576 | self.label_cpu.setText("Uso da CPU: 32%") 577 | self.label_cpu.setAlignment(QtCore.Qt.AlignCenter) 578 | self.label_cpu.move(10,270) 579 | self.label_cpu.setStyleSheet('QLabel {font-size:14px;color:#000079}') 580 | self.label_cpu.resize(131,20) 581 | cpu = QTimer(self) 582 | cpu.timeout.connect(self.MostrarCPU) 583 | cpu.start(1000) 584 | 585 | self.label_assv = QLabel(self) 586 | self.label_assv.setText("Assistente Virtual") 587 | self.label_assv.move(5,5) 588 | self.label_assv.setStyleSheet('QLabel {font:bold;font-size:14px;color:#000079}') 589 | self.label_assv.resize(200,20) 590 | 591 | self.label_version = QLabel(self) 592 | self.label_version.setText("Alpha version 1.2.1") 593 | self.label_version.setAlignment(QtCore.Qt.AlignCenter) 594 | self.label_version.move(265,270) 595 | self.label_version.setStyleSheet('QLabel {font-size:14px;color:#000079}') 596 | self.label_version.resize(131,20) 597 | 598 | data = QDate.currentDate() 599 | datahoje = data.toString('dd/MM/yyyy') 600 | self.label_data = QLabel(self) 601 | self.label_data.setText(datahoje) 602 | self.label_data.setAlignment(QtCore.Qt.AlignCenter) 603 | self.label_data.move(316,25) 604 | self.label_data.setStyleSheet('QLabel {font-size:14px;color:#000079}') 605 | self.label_data.resize(75,20) 606 | 607 | self.label_horas = QLabel(self) 608 | self.label_horas.setText("22:36:09") 609 | self.label_horas.setAlignment(QtCore.Qt.AlignCenter) 610 | self.label_horas.move(0,25) 611 | self.label_horas.setStyleSheet('QLabel {font-size:14px;color:#000079}') 612 | self.label_horas.resize(71,20) 613 | horas = QTimer(self) 614 | horas.timeout.connect(self.MostrarHorras) 615 | horas.start(1000) 616 | 617 | botao_fechar = QPushButton("",self) 618 | botao_fechar.move(370,5) 619 | botao_fechar.resize(20,20) 620 | botao_fechar.setStyleSheet("background-image : url(fechar.png);border-radius: 15px") 621 | botao_fechar.clicked.connect(self.fechartudo) 622 | 623 | self.CarregarJanela() 624 | 625 | def CarregarJanela(self): 626 | self.setWindowFlag(Qt.FramelessWindowHint) #sem botoes e titulo 627 | self.setGeometry(50,50,400,300) 628 | self.setMinimumSize(400, 300) 629 | self.setMaximumSize(400, 300) 630 | self.setWindowOpacity(0.98) 631 | self.setWindowIcon(QtGui.QIcon('icone.png')) 632 | self.setWindowTitle("Assistente Virtual") 633 | self.show() 634 | 635 | def fechartudo(self): 636 | print('botao fechar presionado') 637 | sys.exit() 638 | 639 | def mousePressEvent(self, event): 640 | 641 | if event.buttons() == Qt.LeftButton: 642 | self.dragPos = event.globalPos() 643 | event.accept() 644 | 645 | def mouseMoveEvent(self, event): 646 | 647 | if event.buttons() == Qt.LeftButton: 648 | self.move(self.pos() + event.globalPos() - self.dragPos) 649 | self.dragPos = event.globalPos() 650 | event.accept() 651 | 652 | def MostrarHorras(self): 653 | hora_atual = QTime.currentTime() 654 | label_time = hora_atual.toString('hh:mm:ss') 655 | self.label_horas.setText(label_time) 656 | 657 | def MostrarCPU(self): 658 | usocpu = str(psutil.cpu_percent()) 659 | self.label_cpu.setText("Uso da CPU: " +usocpu +"%") 660 | 661 | aplicacao = QApplication(sys.argv) 662 | j = Janela() 663 | sys.exit(aplicacao.exec_()) 664 | 665 | -------------------------------------------------------------------------------- /ParaTudoFuncionar.txt: -------------------------------------------------------------------------------- 1 | Conheça o J.A.R.V.I.S 2 | Um assistente virtual feito em Python 3 | Ele usa um sistema de reconhecimento de voz offline 4 | 5 | 6 | Seu ultimo Update foi feito em 21/01/2021 7 | 8 | Desenvolvedor:JaimeJG 9 | 10 | 11 | # PARA TUDO FUNCIONAR: 12 | # Primeiro instale o pip: sudo apt-get install python3-pip 13 | # Atualize o pip com o comando: pip3 install -U pip 14 | 15 | INSTALE ALGUNS MODULOS: 16 | # sudo apt-get install python3-pyaudio 17 | # sudo apt-get install espeak 18 | # sudo apt-get install python3-dbus 19 | # sudo apt-get install python3-pyqt5 20 | 21 | AGORA ALGUMAS INSTALAÇÕES EM PIP3: 22 | # pip3 install SpeechRecognition 23 | # pip3 install pyttsx3 24 | # pip3 install datetime 25 | # pip3 install espeakng 26 | # pip3 install psutil 27 | # pip3 install python-vlc 28 | # pip3 install vosk 29 | # pip3 install jsonlib-python3 30 | # pip3 install plyer 31 | # pip3 install wikipedia 32 | # pip3 install gTTS 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JARVIS-Python 2 | 3 | Conheça o J.A.R.V.I.S 4 | 5 | Um assistente virtual feito em Python e QT 6 | 7 | Ele usa um sistema de reconhecimento de voz offline 8 | 9 | Atualmente foi projetado para funcionar em distros linux baseadas em debian 10 | 11 | Seu ultimo Update foi feito em 02/02/2021 12 | 13 | Desenvolvedor:JaimeJG 14 | 15 | OBS: Abra o arquivo "ParaTudoFuncionar.txt" 16 | 17 | Nele contem instruções de instalação dos modulos necessários para seu funcionamento 18 | -------------------------------------------------------------------------------- /StartSound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/StartSound.mp3 -------------------------------------------------------------------------------- /fechar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/fechar.png -------------------------------------------------------------------------------- /icone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/icone.png -------------------------------------------------------------------------------- /model-br/Gr.fst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/Gr.fst -------------------------------------------------------------------------------- /model-br/HCLr.fst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/HCLr.fst -------------------------------------------------------------------------------- /model-br/README: -------------------------------------------------------------------------------- 1 | Portuguese model for android 2 | -------------------------------------------------------------------------------- /model-br/disambig_tid.int: -------------------------------------------------------------------------------- 1 | 11381 2 | 11382 3 | 11383 4 | 11384 5 | 11385 6 | 11386 7 | 11387 8 | 11388 9 | 11389 10 | -------------------------------------------------------------------------------- /model-br/final.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/final.mdl -------------------------------------------------------------------------------- /model-br/ivector/final.dubm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/ivector/final.dubm -------------------------------------------------------------------------------- /model-br/ivector/final.ie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/ivector/final.ie -------------------------------------------------------------------------------- /model-br/ivector/final.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaimeJGJG/JARVIS-Python/c366fe43c4de2cea49c3c4569236606cd0106869/model-br/ivector/final.mat -------------------------------------------------------------------------------- /model-br/ivector/global_cmvn.stats: -------------------------------------------------------------------------------- 1 | [ 2 | 5.621864e+09 -3.61508e+08 8.637199e+07 3.324517e+08 -3.323625e+08 -3.969682e+08 -5.677247e+08 -3.363187e+08 -2.560426e+08 -5.828718e+07 -5.735994e+07 -1.727248e+08 -1.921315e+08 -243469.1 -1.114188e+08 -1.499579e+08 -2.986899e+07 -2.723944e+07 -3.31755e+07 758787.7 7.084189e+07 3 | 4.552163e+11 1.696032e+10 1.358537e+10 1.90937e+10 1.775472e+10 1.721642e+10 1.958017e+10 1.442598e+10 1.461493e+10 1.236114e+10 9.68765e+09 9.376157e+09 7.71376e+09 5.798623e+09 4.252169e+09 3.14616e+09 1.832301e+09 1.183567e+09 7.921606e+08 4.095449e+08 0 ] 4 | -------------------------------------------------------------------------------- /model-br/ivector/online_cmvn.conf: -------------------------------------------------------------------------------- 1 | # configuration file for apply-cmvn-online, used in the script ../local/run_online_decoding.sh 2 | -------------------------------------------------------------------------------- /model-br/ivector/splice.conf: -------------------------------------------------------------------------------- 1 | --left-context=3 2 | --right-context=3 3 | -------------------------------------------------------------------------------- /model-br/mfcc.conf: -------------------------------------------------------------------------------- 1 | --sample-frequency=16000 2 | --use-energy=false 3 | --num-mel-bins=20 4 | --num-ceps=20 5 | --low-freq=20 6 | --high-freq=7600 7 | --allow-upsample=true 8 | --allow-downsample=true 9 | -------------------------------------------------------------------------------- /model-br/phones.txt: -------------------------------------------------------------------------------- 1 | 0 2 | SIL 1 3 | SIL_B 2 4 | SIL_E 3 5 | SIL_I 4 6 | SIL_S 5 7 | GBG 6 8 | GBG_B 7 9 | GBG_E 8 10 | GBG_I 9 11 | GBG_S 10 12 | E_B 11 13 | E_E 12 14 | E_I 13 15 | E_S 14 16 | J_B 15 17 | J_E 16 18 | J_I 17 19 | J_S 18 20 | L_B 19 21 | L_E 20 22 | L_I 21 23 | L_S 22 24 | O_B 23 25 | O_E 24 26 | O_I 25 27 | O_S 26 28 | R_B 27 29 | R_E 28 30 | R_I 29 31 | R_S 30 32 | S_B 31 33 | S_E 32 34 | S_I 33 35 | S_S 34 36 | X_B 35 37 | X_E 36 38 | X_I 37 39 | X_S 38 40 | Z_B 39 41 | Z_E 40 42 | Z_I 41 43 | Z_S 42 44 | a_B 43 45 | a_E 44 46 | a_I 45 47 | a_S 46 48 | aa_B 47 49 | aa_E 48 50 | aa_I 49 51 | aa_S 50 52 | a~_B 51 53 | a~_E 52 54 | a~_I 53 55 | a~_S 54 56 | b_B 55 57 | b_E 56 58 | b_I 57 59 | b_S 58 60 | d_B 59 61 | d_E 60 62 | d_I 61 63 | d_S 62 64 | dZ_B 63 65 | dZ_E 64 66 | dZ_I 65 67 | dZ_S 66 68 | dz_B 67 69 | dz_E 68 70 | dz_I 69 71 | dz_S 70 72 | e_B 71 73 | e_E 72 74 | e_I 73 75 | e_S 74 76 | ee_B 75 77 | ee_E 76 78 | ee_I 77 79 | ee_S 78 80 | em_B 79 81 | em_E 80 82 | em_I 81 83 | em_S 82 84 | e~_B 83 85 | e~_E 84 86 | e~_I 85 87 | e~_S 86 88 | f_B 87 89 | f_E 88 90 | f_I 89 91 | f_S 90 92 | g_B 91 93 | g_E 92 94 | g_I 93 95 | g_S 94 96 | i_B 95 97 | i_E 96 98 | i_I 97 99 | i_S 98 100 | ii_B 99 101 | ii_E 100 102 | ii_I 101 103 | ii_S 102 104 | i~_B 103 105 | i~_E 104 106 | i~_I 105 107 | i~_S 106 108 | j_B 107 109 | j_E 108 110 | j_I 109 111 | j_S 110 112 | jj_B 111 113 | jj_E 112 114 | jj_I 113 115 | jj_S 114 116 | jm_B 115 117 | jm_E 116 118 | jm_I 117 119 | jm_S 118 120 | j~_B 119 121 | j~_E 120 122 | j~_I 121 123 | j~_S 122 124 | k_B 123 125 | k_E 124 126 | k_I 125 127 | k_S 126 128 | l_B 127 129 | l_E 128 130 | l_I 129 131 | l_S 130 132 | lm_B 131 133 | lm_E 132 134 | lm_I 133 135 | lm_S 134 136 | m_B 135 137 | m_E 136 138 | m_I 137 139 | m_S 138 140 | n_B 139 141 | n_E 140 142 | n_I 141 143 | n_S 142 144 | o_B 143 145 | o_E 144 146 | o_I 145 147 | o_S 146 148 | om_B 147 149 | om_E 148 150 | om_I 149 151 | om_S 150 152 | oo_B 151 153 | oo_E 152 154 | oo_I 153 155 | oo_S 154 156 | o~_B 155 157 | o~_E 156 158 | o~_I 157 159 | o~_S 158 160 | p_B 159 161 | p_E 160 162 | p_I 161 163 | p_S 162 164 | r_B 163 165 | r_E 164 166 | r_I 165 167 | r_S 166 168 | rm_B 167 169 | rm_E 168 170 | rm_I 169 171 | rm_S 170 172 | s_B 171 173 | s_E 172 174 | s_I 173 175 | s_S 174 176 | sm_B 175 177 | sm_E 176 178 | sm_I 177 179 | sm_S 178 180 | t_B 179 181 | t_E 180 182 | t_I 181 183 | t_S 182 184 | tS_B 183 185 | tS_E 184 186 | tS_I 185 187 | tS_S 186 188 | ts_B 187 189 | ts_E 188 190 | ts_I 189 191 | ts_S 190 192 | u_B 191 193 | u_E 192 194 | u_I 193 195 | u_S 194 196 | uu_B 195 197 | uu_E 196 198 | uu_I 197 199 | uu_S 198 200 | u~_B 199 201 | u~_E 200 202 | u~_I 201 203 | u~_S 202 204 | v_B 203 205 | v_E 204 206 | v_I 205 207 | v_S 206 208 | w_B 207 209 | w_E 208 210 | w_I 209 211 | w_S 210 212 | ww_B 211 213 | ww_E 212 214 | ww_I 213 215 | ww_S 214 216 | w~_B 215 217 | w~_E 216 218 | w~_I 217 219 | w~_S 218 220 | xm_B 219 221 | xm_E 220 222 | xm_I 221 223 | xm_S 222 224 | z_B 223 225 | z_E 224 226 | z_I 225 227 | z_S 226 228 | zm_B 227 229 | zm_E 228 230 | zm_I 229 231 | zm_S 230 232 | #0 231 233 | #1 232 234 | #2 233 235 | #3 234 236 | #4 235 237 | #5 236 238 | #6 237 239 | #7 238 240 | #8 239 241 | -------------------------------------------------------------------------------- /model-br/word_boundary.int: -------------------------------------------------------------------------------- 1 | 1 nonword 2 | 2 begin 3 | 3 end 4 | 4 internal 5 | 5 singleton 6 | 6 nonword 7 | 7 begin 8 | 8 end 9 | 9 internal 10 | 10 singleton 11 | 11 begin 12 | 12 end 13 | 13 internal 14 | 14 singleton 15 | 15 begin 16 | 16 end 17 | 17 internal 18 | 18 singleton 19 | 19 begin 20 | 20 end 21 | 21 internal 22 | 22 singleton 23 | 23 begin 24 | 24 end 25 | 25 internal 26 | 26 singleton 27 | 27 begin 28 | 28 end 29 | 29 internal 30 | 30 singleton 31 | 31 begin 32 | 32 end 33 | 33 internal 34 | 34 singleton 35 | 35 begin 36 | 36 end 37 | 37 internal 38 | 38 singleton 39 | 39 begin 40 | 40 end 41 | 41 internal 42 | 42 singleton 43 | 43 begin 44 | 44 end 45 | 45 internal 46 | 46 singleton 47 | 47 begin 48 | 48 end 49 | 49 internal 50 | 50 singleton 51 | 51 begin 52 | 52 end 53 | 53 internal 54 | 54 singleton 55 | 55 begin 56 | 56 end 57 | 57 internal 58 | 58 singleton 59 | 59 begin 60 | 60 end 61 | 61 internal 62 | 62 singleton 63 | 63 begin 64 | 64 end 65 | 65 internal 66 | 66 singleton 67 | 67 begin 68 | 68 end 69 | 69 internal 70 | 70 singleton 71 | 71 begin 72 | 72 end 73 | 73 internal 74 | 74 singleton 75 | 75 begin 76 | 76 end 77 | 77 internal 78 | 78 singleton 79 | 79 begin 80 | 80 end 81 | 81 internal 82 | 82 singleton 83 | 83 begin 84 | 84 end 85 | 85 internal 86 | 86 singleton 87 | 87 begin 88 | 88 end 89 | 89 internal 90 | 90 singleton 91 | 91 begin 92 | 92 end 93 | 93 internal 94 | 94 singleton 95 | 95 begin 96 | 96 end 97 | 97 internal 98 | 98 singleton 99 | 99 begin 100 | 100 end 101 | 101 internal 102 | 102 singleton 103 | 103 begin 104 | 104 end 105 | 105 internal 106 | 106 singleton 107 | 107 begin 108 | 108 end 109 | 109 internal 110 | 110 singleton 111 | 111 begin 112 | 112 end 113 | 113 internal 114 | 114 singleton 115 | 115 begin 116 | 116 end 117 | 117 internal 118 | 118 singleton 119 | 119 begin 120 | 120 end 121 | 121 internal 122 | 122 singleton 123 | 123 begin 124 | 124 end 125 | 125 internal 126 | 126 singleton 127 | 127 begin 128 | 128 end 129 | 129 internal 130 | 130 singleton 131 | 131 begin 132 | 132 end 133 | 133 internal 134 | 134 singleton 135 | 135 begin 136 | 136 end 137 | 137 internal 138 | 138 singleton 139 | 139 begin 140 | 140 end 141 | 141 internal 142 | 142 singleton 143 | 143 begin 144 | 144 end 145 | 145 internal 146 | 146 singleton 147 | 147 begin 148 | 148 end 149 | 149 internal 150 | 150 singleton 151 | 151 begin 152 | 152 end 153 | 153 internal 154 | 154 singleton 155 | 155 begin 156 | 156 end 157 | 157 internal 158 | 158 singleton 159 | 159 begin 160 | 160 end 161 | 161 internal 162 | 162 singleton 163 | 163 begin 164 | 164 end 165 | 165 internal 166 | 166 singleton 167 | 167 begin 168 | 168 end 169 | 169 internal 170 | 170 singleton 171 | 171 begin 172 | 172 end 173 | 173 internal 174 | 174 singleton 175 | 175 begin 176 | 176 end 177 | 177 internal 178 | 178 singleton 179 | 179 begin 180 | 180 end 181 | 181 internal 182 | 182 singleton 183 | 183 begin 184 | 184 end 185 | 185 internal 186 | 186 singleton 187 | 187 begin 188 | 188 end 189 | 189 internal 190 | 190 singleton 191 | 191 begin 192 | 192 end 193 | 193 internal 194 | 194 singleton 195 | 195 begin 196 | 196 end 197 | 197 internal 198 | 198 singleton 199 | 199 begin 200 | 200 end 201 | 201 internal 202 | 202 singleton 203 | 203 begin 204 | 204 end 205 | 205 internal 206 | 206 singleton 207 | 207 begin 208 | 208 end 209 | 209 internal 210 | 210 singleton 211 | 211 begin 212 | 212 end 213 | 213 internal 214 | 214 singleton 215 | 215 begin 216 | 216 end 217 | 217 internal 218 | 218 singleton 219 | 219 begin 220 | 220 end 221 | 221 internal 222 | 222 singleton 223 | 223 begin 224 | 224 end 225 | 225 internal 226 | 226 singleton 227 | 227 begin 228 | 228 end 229 | 229 internal 230 | 230 singleton 231 | --------------------------------------------------------------------------------