├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .idea ├── .gitignore ├── Meet_bot.iml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── background ├── bgrun1.py ├── bgrun2.py └── bgrun3.py ├── clearall.sh ├── configure.sh ├── images ├── 1.jpeg ├── 2.jpeg ├── 3.jpeg └── jiit128.png ├── main.py ├── require ├── alert.wav ├── names.txt └── roll_call.wav ├── run.sh ├── setup ├── __pycache__ │ ├── recording.cpython-37.pyc │ └── recording.cpython-38.pyc ├── initialize.py └── recording.py └── temp ├── tempfile1.txt ├── tempfile2.txt └── tempfile3.txt /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/Meet_bot.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at dscjiit128@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 DSC JIIT Noida-128 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # class_bot 2 | ![Hits](https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2Fdsc-jiit-128%2Fclass_bot) 3 | [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fdsc-jiit-128%2Fclass_bot&count_bg=%233D58C8&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=smash&edge_flat=false)](https://hits.seeyoufarm.com) 4 | [![GitHub stars](https://img.shields.io/github/stars/dsc-jiit-128/class_bot?color=green)](https://github.com/dsc-jiit-128/class_bot/stargazers) 5 | [![GitHub forks](https://img.shields.io/github/forks/dsc-jiit-128/class_bot?color=green)](https://github.com/dsc-jiit-128/class_bot/network) 6 | [![GitHub issues](https://img.shields.io/github/issues/dsc-jiit-128/class_bot)](https://github.com/dsc-jiit-128/class_bot/issues) 7 | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?)](https://github.com/dsc-jiit-128/class_bot/issues) 8 | 9 | An Automated Background Python program that notifies you during your meetings. 10 | 11 | **OSX and Linux** 12 | 13 | ### Installation :- ### 14 | 15 | **C Dependencies :-** 16 | - `Portaudio:` 17 | 18 | 1. Download the file from http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz. 19 | 2. Unzip the file. 20 | 3. Run `./configure` in the root of the extracted folder. 21 | 4. Run `sudo make` in the root folder. 22 | 5. Run `sudo make install` in the root folder. 23 | 6. Run `sudo ldconfig` in the root folder. 24 | 25 | **Python Dependencies :-** 26 | - `pip install pyaudio` 27 | - `pip install pydub` 28 | - `pip install speechrecognition` 29 | - `pip install wave` 30 | 31 | **Pulse Audio :-** 32 | - Make sure that you have pulse audio already installed in your system (Most Linux Distrubutions already have Pulse Audio installed). 33 | If not installed, please install it from your package manager :) 34 | - *[Installation Commands](https://command-not-found.com/pacmd)* Install pulse audio command line utility from this link. 35 | - Install Pulse Audio GUI from you package manager 36 | 37 | ### Setup and Usage:- ### 38 | 39 | **Configuration :-** 40 | - Run `./configure.sh` and follow the instructions *(You only have to do this once)* . 41 | 1. `Speak your name when prompted.` 42 | 2. `Select the options as 1 ENTER 2 ENTER 5 ENTER q ENTER` 43 | - Run `./run.sh` to start the program *(Every time you reboot, run `./clearall.sh` or your name gets called!)*. 44 | - You can close the terminal window after this and all the logs will be present in `nohup.out`. 45 | - Open Pulse Audio GUI and click on `Recording Tab`. 46 | - Select the sink for 3 python programs as `Monitor of Temp_sink`. 47 | 48 | 49 | 50 | - Go to `Playback` Tab. 51 | - Select `Temp_sink` as device for all the applications whose sound you want to monitor. 52 | 53 | 54 | 55 | - Select `Analog Built-in-stereo-output` as device for all the applications whose sound you dont want to monitor and want to listen. 56 | 57 | 58 | 59 | - **Voila**, Now you can listen to music or do some side projects and whenever your name gets called, you'll be **Notified**. 60 | 61 | **Footnotes :-** 62 | - Run `./clearall.sh` to remove all the temporary created files and modules and set everything back to **Normal**. 63 | - Give all the Bash Scripts **Execute** premission using `sudo chmod +x ./` where filename is `run.sh`, `configure.sh`, `clearall.sh` *(Avoid < >)*. 64 | - Whenever your name gets called or attendence is being recorded, it'll prompted and all the settings will set to default. 65 | Run `./run.sh` again to start over. 66 | 67 | 68 | [![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) 69 | [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) 70 | [![forthebadge](https://forthebadge.com/images/badges/you-didnt-ask-for-this.svg)](https://forthebadge.com) 71 | 72 | **Star Developer:** **[manasd28 (Manas Dalakoti)](https://github.com/manasd28)** 73 |

Developer Student Clubs JIIT 128

74 | 75 |

PLEASE NOTE:

76 |

For legal reasons,
77 | This bot was purely made for educational purposes only and is meant as a fun way to learn and implement the libraries/packages mentioned above.
78 | This bot is not meant to be used in any malicious way and we are not responsible for anyone actually using this bot to wrongfully attend online classes on his/her/their behalf.

79 | -------------------------------------------------------------------------------- /background/bgrun1.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import os 3 | import time 4 | 5 | r1 = sr.Recognizer() 6 | 7 | names = [] 8 | 9 | while True: 10 | f = open("./temp/tempfile1.txt",'+a') 11 | flag = 0 12 | with sr.Microphone() as source : 13 | #print('\nSPEAK NOW\n') 14 | r1.adjust_for_ambient_noise(source, duration=0.2) 15 | audio = r1.listen(source, phrase_time_limit = 3) 16 | text = r1.recognize_google(audio, language="en-IN", show_all=True) 17 | try: 18 | dict = text['alternative'] 19 | for i in dict: 20 | s = i["transcript"].lower() 21 | k = s.split(" ") 22 | for j in k: 23 | j = str(j) 24 | f.write(j+'\n') 25 | except Exception as e: 26 | continue 27 | f.close() 28 | -------------------------------------------------------------------------------- /background/bgrun2.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import os 3 | import time 4 | 5 | time.sleep(1) 6 | 7 | r1 = sr.Recognizer() 8 | 9 | names = [] 10 | 11 | while True: 12 | f = open("./temp/tempfile2.txt",'+a') 13 | flag = 0 14 | with sr.Microphone() as source : 15 | #print('\nSPEAK NOW\n') 16 | r1.adjust_for_ambient_noise(source, duration=0.2) 17 | audio = r1.listen(source, phrase_time_limit = 3) 18 | text = r1.recognize_google(audio, language="en-IN", show_all=True) 19 | try: 20 | dict = text['alternative'] 21 | for i in dict: 22 | s = i["transcript"].lower() 23 | k = s.split(" ") 24 | for j in k: 25 | j = str(j) 26 | f.write(j+'\n') 27 | except Exception as e: 28 | continue 29 | f.close() 30 | -------------------------------------------------------------------------------- /background/bgrun3.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import os 3 | import time 4 | 5 | time.sleep(2) 6 | 7 | r1 = sr.Recognizer() 8 | 9 | names = [] 10 | 11 | while True: 12 | f = open("./temp/tempfile3.txt",'+a') 13 | flag = 0 14 | with sr.Microphone() as source : 15 | #print('\nSPEAK NOW\n') 16 | r1.adjust_for_ambient_noise(source, duration=0.2) 17 | audio = r1.listen(source, phrase_time_limit = 3) 18 | text = r1.recognize_google(audio, language="en-IN", show_all=True) 19 | try: 20 | dict = text['alternative'] 21 | for i in dict: 22 | s = i["transcript"].lower() 23 | k = s.split(" ") 24 | for j in k: 25 | j = str(j) 26 | f.write(j+'\n') 27 | except Exception as e: 28 | continue 29 | f.close() 30 | -------------------------------------------------------------------------------- /clearall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ps -A | grep python | awk -F' ' '{print $1}' | while read x;do kill $x; done 4 | mod1=`pacmd list-modules | grep null-sink -B 1 | awk -F" " '{print $2}' | head -n 1` 5 | pacmd unload-module $mod1 6 | rm -rf nohup.out 7 | notify-send "RUN THE BOT AGAIN IF YOU WANT TO CONTINUE" "Run ./run.sh"; aplay ./require/alert.wav; 8 | 9 | -------------------------------------------------------------------------------- /configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python ./setup/initialize.py; 4 | -------------------------------------------------------------------------------- /images/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/images/1.jpeg -------------------------------------------------------------------------------- /images/2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/images/2.jpeg -------------------------------------------------------------------------------- /images/3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/images/3.jpeg -------------------------------------------------------------------------------- /images/jiit128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/images/jiit128.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import os 3 | import webbrowser as wb 4 | import time 5 | from pydub import AudioSegment 6 | from pydub.playback import play 7 | 8 | path = "./require" 9 | roll_call = AudioSegment.from_wav("./require/roll_call.wav") 10 | r1 = sr.Recognizer() 11 | 12 | f = open(path+"/names.txt",'r') 13 | lines = f.readlines() 14 | f.close() 15 | 16 | names = [] 17 | 18 | for i in lines: 19 | i = i.rstrip('\n') 20 | names.append(i) 21 | 22 | flag = 0 23 | 24 | #link = input("Please provide the Goole Meet link\n") 25 | #wb.open(link) 26 | 27 | found_names = [] 28 | alert_cmd = "notify-send \"YOUR NAME IS BEING CALLED!!!\" \"Return to your meeting ASAP\"; aplay ./require/alert.wav" 29 | at_alert_cmd = "notify-send \"LOOKS LIKE ATTNEDENCE IS GOING ON!!!\" \"Return to your meeting ASAP\"; aplay ./require/alert.wav" 30 | rerun_alert_cmd = "notify-send \"RUN THE BOT AGAIN IF YOU WANT TO CONTINUE\" \"./run.sh\"; aplay ./require/alert.wav" 31 | call_cmd = "./clearall.sh" 32 | 33 | at = 0 34 | 35 | while True: 36 | flag = 0 37 | f1 = open('./temp/tempfile1.txt','+r') 38 | f2 = open('./temp/tempfile2.txt','+r') 39 | f3 = open('./temp/tempfile3.txt','+r') 40 | l1 = f1.readlines() 41 | l2 = f2.readlines() 42 | l3 = f3.readlines() 43 | temp = l1 + l2 + l3 44 | for i in temp: 45 | i = i.rstrip('\n') 46 | found_names.append(i) 47 | 48 | print(found_names,'\n') 49 | 50 | if("attendance" in found_names): 51 | os.system(at_alert_cmd) 52 | flag = 1 53 | 54 | if("present" in found_names): 55 | at+=1 56 | print("\nPresent Found") 57 | flag = 1 58 | 59 | if(at >= 4): 60 | os.system(at_alert_cmd) 61 | at = 0 62 | flag = 1 63 | 64 | for i in names: 65 | if(i in found_names) : 66 | print("\nName Found") 67 | flag = 1 68 | os.system(alert_cmd) 69 | break 70 | 71 | if(flag == 1): 72 | time.sleep(5) 73 | os.system(call_cmd) 74 | 75 | f1.close() 76 | f2.close() 77 | f3.close() 78 | 79 | f1 = open('./temp/tempfile1.txt','w').close() 80 | f2 = open('./temp/tempfile2.txt','w').close() 81 | f3 = open('./temp/tempfile3.txt','w').close() 82 | 83 | del found_names[:] 84 | 85 | if(flag == 1): 86 | time.sleep(5) 87 | os.system(rerun_alert_cmd) 88 | time.sleep(1) 89 | os.system(call_cmd) 90 | 91 | time.sleep(4) 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /require/alert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/require/alert.wav -------------------------------------------------------------------------------- /require/names.txt: -------------------------------------------------------------------------------- 1 | manas 2 | mansa 3 | maana 4 | -------------------------------------------------------------------------------- /require/roll_call.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/require/roll_call.wav -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ps -A | grep python | awk -F' ' '{print $1}' | while read x;do kill $x; done 4 | 5 | mod1=`pacmd list-modules | grep null-sink -B 1 | awk -F" " '{print $2}' | head -n 1` 6 | pacmd unload-module $mod1 7 | pacmd load-module module-null-sink sink_name=Temp sink_properties=device.description="Temporary_sink" 8 | str=`pacmd list-sources | grep "stereo.monitor" | sed 's/.*<\(.*\)>/\1/'` 9 | pacmd load-module module-loopback sink=Temp source=${str} 10 | 11 | nohup python ./background/bgrun1.py& 12 | nohup python ./background/bgrun2.py& 13 | nohup python ./background/bgrun3.py& 14 | nohup python ./main.py& 15 | -------------------------------------------------------------------------------- /setup/__pycache__/recording.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/setup/__pycache__/recording.cpython-37.pyc -------------------------------------------------------------------------------- /setup/__pycache__/recording.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/setup/__pycache__/recording.cpython-38.pyc -------------------------------------------------------------------------------- /setup/initialize.py: -------------------------------------------------------------------------------- 1 | import speech_recognition as sr 2 | import os 3 | import time 4 | import wave 5 | 6 | import recording 7 | 8 | path='./require/' 9 | if(os.path.exists(path+"names.txt")): 10 | os.remove(path+"names.txt") 11 | 12 | r1 = sr.Recognizer() 13 | f = open(path+"names.txt",'w') 14 | 15 | print("This is a demo run that helps you select the names by which the bot will recognize you\n") 16 | 17 | names = [] 18 | ind = 0 19 | while(ind<3): 20 | with sr.Microphone() as source: 21 | print("SPEAK YOUR NAME NOW ({})\n".format(ind+1)) 22 | r1.adjust_for_ambient_noise(source, duration=0.2) 23 | audio = r1.listen(source, phrase_time_limit=5) 24 | text = r1.recognize_google(audio, language="en-IN", show_all=True) 25 | print(text) 26 | try : 27 | dict = text['alternative'] 28 | for j in dict: 29 | if(j['transcript'] not in names): 30 | names.append(j['transcript']) 31 | ind+=1 32 | except TypeError: 33 | print("Please speak again close to microphone!!\n") 34 | 35 | ind=1 36 | for i in names : 37 | print("{}. ".format(ind), i) 38 | ind+=1 39 | 40 | print("PLEASE ENTER THE NUMBER OF THE NAME YOU THINK IS CLOSEST TO YOURS AND IS NOT SOMETHING THAT'LL BE A PART OF THE MEETING\n") 41 | print("MORE NAMES YOU CHOOSE THE BETTER THE RECOGNITION CHANCES ARE!!\n") 42 | print("Enter the number(s) from the list of names (q to QUIT)\n") 43 | temp = [] 44 | while(True): 45 | a = input() 46 | if(a == 'q'): 47 | break 48 | a = int(a) 49 | if a not in temp and a>0 and a<=len(names): 50 | temp.append(a) 51 | f.write((names[a-1]+os.linesep).lower()) 52 | else: 53 | print("The name already exists or invalid index number entered!!\n") 54 | 55 | #input("PRESS ENTER TO CONTINUE!!\n") 56 | #print("Excellent!!\nNow please be ready to record your audio that will answer your roll call!!\n") 57 | 58 | #recording.start_recording() 59 | 60 | print("WE ARE ALL SET UP NOW!!\n") 61 | 62 | f.close() 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /setup/recording.py: -------------------------------------------------------------------------------- 1 | import pyaudio 2 | import time 3 | import wave 4 | 5 | 6 | def start_recording(): 7 | chunk = 1024 8 | sample_format = pyaudio.paInt16 9 | channels = 2 10 | fs = 44100 11 | seconds = 3 12 | filename = "./require/roll_call.wav" 13 | 14 | p = pyaudio.PyAudio() 15 | 16 | print("Recoding : \n") 17 | input("Press ENTER to start 3 second recording\n\n(Please speak closely and loudly!!)\n") 18 | 19 | stream = p.open(format=sample_format, 20 | channels=channels, 21 | rate=fs, 22 | frames_per_buffer=chunk, 23 | input=True) 24 | 25 | frames = [] 26 | 27 | for i in range(0, int(fs / chunk * seconds)): 28 | data = stream.read(chunk) 29 | frames.append(data) 30 | 31 | stream.stop_stream() 32 | stream.close() 33 | 34 | p.terminate() 35 | 36 | wf = wave.open(filename, 'wb') 37 | wf.setnchannels(channels) 38 | wf.setsampwidth(p.get_sample_size(sample_format)) 39 | wf.setframerate(fs) 40 | wf.writeframes(b''.join(frames)) 41 | wf.close() 42 | 43 | -------------------------------------------------------------------------------- /temp/tempfile1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/temp/tempfile1.txt -------------------------------------------------------------------------------- /temp/tempfile2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/temp/tempfile2.txt -------------------------------------------------------------------------------- /temp/tempfile3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsc-jiit-128/class_bot/f2ed095cb76d3ce35f9600ca3a8f52e226aa443e/temp/tempfile3.txt --------------------------------------------------------------------------------