Metadata-Version: 2.1
Name: bhashan2pathtak
Version: 0.1.0
Summary: A simple speech-to-text application using Wit.ai
Home-page: https://github.com/nilukush/bhashan2pathtak
Author: Nilesh Kumar
Author-email: nilukush@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: SpeechRecognition>=3.8.1
Requires-Dist: PyAudio>=0.2.11
Requires-Dist: wit>=6.0.0

# bhashan2pathtak
Simple Python application to convert speech into text using Wit.ai

## Prerequisites for MacOS
* `brew install portaudio`
* `brew install flac`

## Features
- Continuous speech recognition
- Improved accuracy using Wit.ai
- Ambient noise adjustment
- Error handling and user-friendly feedback

## Setup

Before using bhashan2pathtak, you need to set up a Wit.ai account and obtain a token:

1. Go to https://wit.ai/ and create an account if you haven't already.
2. Create a new Wit.ai app and copy your Client Access Token.
3. Set your token using one of these methods:
   a. Set an environment variable:
      ```
      export WIT_AI_TOKEN=your_token_here
      ```
   b. Create a `config.json` file in the directory where you'll run the application, with the following content:
      ```json
      {
          "WIT_AI_TOKEN": "your_token_here"
      }
      ```

## Installation
To use bhashan2pathtak as a package:

1. Install the package:
   ```
   pip install bhashan2pathtak
   ```

2. Run the application:
   ```
   bhashan2pathtak
   ```

Note: You still need to configure your Wit.ai token as described in the Setup section.

## Development Setup
1. Clone this repository
2. Install the required packages:
   ```
   pip install -r requirements.txt
   ```
   Note: This project uses PyAudio 0.2.14. If you encounter issues with installation, try upgrading to this version.
3. Sign up for a Wit.ai account and create a new app to get an access token

## Development Configuration
To run this application, you need to provide your Wit.ai token. You have two options:

1. Environment Variable:
   Set the `WIT_AI_TOKEN` environment variable:
   ```
   export WIT_AI_TOKEN=your_wit_ai_token_here
   ```

2. Configuration File:
   Copy `config.json.example` to `config.json` and add your Wit.ai token:
   ```
   cp config.json.example config.json
   ```
   Then edit `config.json` and replace `your_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.

## How to run
After setting up the configuration:
```
python3 speech_to_text.py
```

## Troubleshooting
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.
