Simple Python application to convert speech into text using Wit.ai
brew install portaudio
brew install flac
- Continuous speech recognition
- Improved accuracy using Wit.ai
- Ambient noise adjustment
- Error handling and user-friendly feedback
Before using bhashan2pathtak, you need to set up a Wit.ai account and obtain a token:
- Go to https://wit.ai/ and create an account if you haven't already.
- Create a new Wit.ai app and copy your Client Access Token.
- Set your token using one of these methods:
a. Set an environment variable:
b. Create a
export WIT_AI_TOKEN=your_token_here
config.json
file in the directory where you'll run the application, with the following content:{ "WIT_AI_TOKEN": "your_token_here" }
To use bhashan2pathtak as a package:
-
Install the package:
pip install bhashan2pathtak
-
Run the application:
bhashan2pathtak
Note: You still need to configure your Wit.ai token as described in the Setup section.
- Clone this repository
- Install the required packages:
Note: This project uses PyAudio 0.2.14. If you encounter issues with installation, try upgrading to this version.
pip install -r requirements.txt
- Sign up for a Wit.ai account and create a new app to get an access token
To run this application, you need to provide your Wit.ai token. You have two options:
-
Environment Variable: Set the
WIT_AI_TOKEN
environment variable:export WIT_AI_TOKEN=your_wit_ai_token_here
-
Configuration File: Copy
config.json.example
toconfig.json
and add your Wit.ai token:cp config.json.example config.json
Then edit
config.json
and replaceyour_wit_ai_token_here
with your actual token.
Important: Never commit your config.json
file to the repository. It's listed in .gitignore
to prevent accidental commits.
After setting up the configuration:
python3 speech_to_text.py
If you encounter any issues with PyAudio, make sure you have version 0.2.14 installed:
pip install PyAudio==0.2.14
For any other issues, please check the Wit.ai documentation or open an issue in this repository.