https://github.com/ndolestudio/speech-to-text-php
Sample PHP/Laravel Application to convert Speech to Text using the IBM Watson API
https://github.com/ndolestudio/speech-to-text-php
Last synced: 3 months ago
JSON representation
Sample PHP/Laravel Application to convert Speech to Text using the IBM Watson API
- Host: GitHub
- URL: https://github.com/ndolestudio/speech-to-text-php
- Owner: NdoleStudio
- License: mit
- Created: 2018-10-24T12:36:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T23:32:33.000Z (over 3 years ago)
- Last Synced: 2025-03-24T14:51:25.676Z (about 1 year ago)
- Language: PHP
- Homepage: https://audio-to-text.ndolestudio.com
- Size: 1.91 MB
- Stars: 7
- Watchers: 3
- Forks: 5
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
#  Speech to Text
**Sample PHP/Laravel web app that transcribes an audio file into text using the IBM Watson Speech to Text service.**
### Introduction
[](https://codeclimate.com/github/NdoleStudio/speech-to-text-php/maintainability)
[](https://codeclimate.com/github/NdoleStudio/speech-to-text-php/test_coverage)
[](https://github.com/prettier/prettier)
[](https://travis-ci.org/NdoleStudio/speech-to-text-php)
This service service uses IBM's [speech recognition capabilities](https://www.ibm.com/watson/services/speech-to-text) to convert speech in multiple languages into text. The transcription of incoming audio is continuously sent back to the client upon completion. The service is accessed via a REST HTTP interface.
Demo URL: **[https://audio-to-text.ndolestudio.com](https://audio-to-text.ndolestudio.com/)**
### Tech Stack
- The Frontend of the comes with [tailwindcss](https://tailwindcss.com) and [Vue.js](https://vuejs.org/).
- The backend is done with PHP using the [Laravel Framework](https://laravel.com/)
- PHPUnit is used for both unit tests and integration tests.
*It's advisable to run the tests using docker*
## Prerequisites
1. Sign up for an [IBM Cloud account](https://console.bluemix.net/registration/).
1. Create an instance of the Speech to Text service and get your credentials:
- Go to the [Speech to Text](https://console.bluemix.net/catalog/services/speech-to-text) page in the IBM Cloud Catalog.
- Log in to your IBM Cloud account.
- Click **Create**.
- Click **Show** to view the service credentials.
- Copy the `apikey` value, or copy the `username` and `password` values if your service instance doesn't provide an `apikey`.
- Copy the `url` value.
1. Sign up for a [Pusher Aaccount](https://dashboard.pusher.com/accounts/sign_up)
1. Create a new app on pusher and get your credentials:
- Log in to your Pusher account.
- Click **Create new app**.
- Set the name of your app and click on the **Create my app** button
- Click **App Keys** to view the app credentials.
- Copy the `app_id`, `key`, `secret` and `cluster` values.
## Configuring the application
1. In the application folder, copy the `.env.example` file and create a file called `.env`
```
cp .env.example .env
```
2. Open the `.env` file and add the service credentials that you obtained in the previous step.
Example `.env` file that configures the `apikey` and `url` for a Speech to Text service instance:
```
SPEECH_TO_TEXT_USERNAME=
SPEECH_TO_TEXT_PASSWORD=
SPEECH_TO_TEXT_URL=https://stream.watsonplatform.net/speech-to-text/api/v1/recognize
```
3. Open the `.env` file and add the service credentials that you obtained in the previous step.
```
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=
```
### Running Locally
Follow the steps below to run this application locally
1. Clone this git repository and `cd` into it
```bash
git clone https://github.com/NdoleStudio/speech-to-text-php.git
cd speech-to-text-php
```
2. Run the docker container
```bash
docker-compose up --build -d
```
3. Open your browser and visit localhost: [http://0.0.0.0:8888](http://0.0.0.0:8888).
### Running Tests
To run tests, setup the application using the setup process shown above and run `phpunit` inside the workspace container
```bash
$ docker exec -it project-workspace /bin/bash
$ phpunit
```
## Built With
* [Guzzle](http://www.dropwizard.io/1.0.2/docs/) - The extensible PHP HTTP client
* [IBM Speech to Text](https://console.bluemix.net/catalog/services/speech-to-text) - IBM's Transcription service
* [Pusher](https://pusher.com) - Powers the real time events
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
## Authors
* **[AchoArnold](https://github.com/AchoArnold)**
See also the list of [contributors](https://github.com/NdoleStudio/darksky-php/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details