This repo contains an Eclipse plugin to convert Speech to Code using Google Cloud Speech-to-text API.
- Clone this repo onto your computer using git.
git clone https://github.com/somahota/Speech-Based-Code-Editor-Project.git
- Launch Eclipse and go to
File->Open Projects from Fileto browse and load theVoice2Codefolder from the repository you just cloned. - Now that the
Voice2Codefolder is in the eclipse-workspace make sure you haveEclipse Plugin Development Toolsinstalled by following the steps below.- Go to
Help->Install New Software. - Select
The Eclipse Project Updates - http://download.eclipse.org/eclipse/updates/4.17from theWork withdropdown. - Select
Eclipse Plugin Development Toolsfrom underName. - Click Next. Once the installation is done, Eclipse will ask to restart, please do so.
- Go to
- Make sure you have
GOOGLE_APPLICATION_CREDENTIALSenvironment variable set up in theRun Configurationsunder Run in Eclipse. (follow this guide to get GCloud key setup) - To run the plugin, right-click the project (make sure that is
Voice2Code) and clickRun As->Eclipse Application. - To view the plugin go to
Window->Show View->Other->Voice 2 Code->Voice 2 Code. - This will open up a new Eclipse window with the GUI with Press to Speak.

- Click
Create a projectto create a standard project, when the GUI is pressed, speak out to view text being coded inside your project. - You will find results like below printed on the console. The confidence score is displayed for the final results (Final: true) after the sentence is completed.
V2T Start
Mic and CloudStream initialized
Transcript: I'm speaking
Confidence: 0.95554876
Final: true
├── Voice2Code
│ └── src
│ ├── edu.brown.cs
│ │ └── plugin
│ │ ├── Voice2Code.java (Eclipse plugin's source)
│ │ └── editor (Helper methods for manipulating the editor)
| ├── text2code (Converts text to code)
│ ├── voice2text (Interacts with Google Speech-to-text API)
│ └── test (Unit tests)- Sign in on the Google Cloud with your Google account.
- Follow these steps to set up a new project with Speech-to-Text API.
- Lastly, follow these steps to create and download the Service Account key.
- This key is downloaded as a JSON file. Please make sure Eclipse has an environment variable set up like below. (Note:
my-keyis a placeholder)
variable: GOOGLE_APPLICATION_CREDENTIALS
value: /home/user/Downloads/<my-key>.json
May things can go wrong with Eclipse.
- If you don't see
Voice 2 Codein the View menu, make sure you have.projectfile inside Eclipse workspace. - If the microphone does not work, due to getting shared with other applications, launch Eclipse from the terminal using this command on MAC OS.
/Applications/Eclipse.app/Contents/MacOS/eclipse &!