diff --git a/scripts/Speech_To_Text/README.md b/scripts/Speech_To_Text/README.md new file mode 100644 index 0000000..18e476c --- /dev/null +++ b/scripts/Speech_To_Text/README.md @@ -0,0 +1,9 @@ +# Speech to Text +This is a simple script that lets you convert speech to text + +#### Usage + +* Clone the repo +* Move to folder "scripts/Speech_To_Text" +* download the python libraries mentioned in requirements.txt using `pip install ` +* run `python script.py` \ No newline at end of file diff --git a/scripts/Speech_To_Text/requirements.txt b/scripts/Speech_To_Text/requirements.txt new file mode 100644 index 0000000..9d62c65 --- /dev/null +++ b/scripts/Speech_To_Text/requirements.txt @@ -0,0 +1 @@ +speech_recognition \ No newline at end of file diff --git a/scripts/Speech_To_Text/sample.wav b/scripts/Speech_To_Text/sample.wav new file mode 100644 index 0000000..b467edc Binary files /dev/null and b/scripts/Speech_To_Text/sample.wav differ diff --git a/scripts/Speech_To_Text/script.py b/scripts/Speech_To_Text/script.py new file mode 100644 index 0000000..a42260f --- /dev/null +++ b/scripts/Speech_To_Text/script.py @@ -0,0 +1,15 @@ +import speech_recognition as sr +import os + +filename = "sample.wav" + +# initialize the recognizer +recognizer = sr.Recognizer() + +# open the file +with sr.AudioFile(filename) as source: + # listen for the data (load audio to memory) + audio_data = recognizer.record(source) + # recognize (convert from speech to text) + text = recognizer.recognize_google(audio_data) + print(text)