In this project, I have used google cloud speech api service for converting speech to text in python program. I have created 2 seperate file such as one file containing conversion from a audio file of extension .wav and one file containing direct speech from microphone. In this project, I have also tried to convert text into different languages such as marathi. In this project, I have observerd that accuracy of speeh to text api is around 70-90% according to the noise level in the speech. I refered this project from website towardsdatascience.com.
Note:
1. The speech to text file needs network or data connection.
2. Audio file supported by speech recognition are wav, AIFF, AIFF-C, FLAC.
I have used female.wav file in this output.
I talked how are you and it returned correctly.
I talked how are you in marathi and it returned correctly.
Clone this repo to your local machine using https://github.com/suyashphatak23/Speech-to-Text
-
Open Command Prompt
-
Install PyAudio and SpeechRecognition python-libray in your local machine by using following commands:
> pip install PyAudio
> pip install SpeechRecognition
-
Run the code in python3 shell
-
If you want to change the audio file just change the file name in the code and note that it should be in the same directory of the code.