Skip to content

Instantly share code, notes, and snippets.

View Eeman1113's full-sized avatar
🙂
Sleep Deprived

Eeman Majumder Eeman1113

🙂
Sleep Deprived
View GitHub Profile
{"intents":
[
{
"tag":"greeting",
"input":["hello","hi there","nice to meet you","hi there boi","any nerds here ?","hi","hey there","hey","hi there","hi, nice to meet you","hello there","anyone there ?","hello nerds","knock knock"],
"responses":[
"Hi. Welcome to the the brain of eeman",
"Ayoo, do you need help ?",
"welcome, how may I help you ?",
"ello there",
from gtts import gTTS
import os
def speak(r):
language='en'
text1=str(r)
myobj = gTTS(text=text1, lang=language, slow=False)
myobj.save("DEW/voice.mp3")
#importing the libraries
import tensorflow as tf
import numpy as np
import pandas as pd
import json
import nltk
import speak
import speech_recognition as sr
# create the recognizer
r = sr.Recognizer()
# define the microphone
mic = sr.Microphone(device_index=0)
# record your speech
with mic as source:
audio = r.listen(source)
# speech recognition
result = r.recognize_google(audio)
# export the result
with open('my_result.txt',mode ='w') as file:
file.write("Recognized text:")
file.write("\n")
file.write(result)
result=str(result)
print("Exporting process completed!")