{"id":19403192,"url":"https://github.com/watson-developer-cloud/speech-to-text-code-pattern","last_synced_at":"2025-04-24T07:32:48.724Z","repository":{"id":55074700,"uuid":"234611460","full_name":"watson-developer-cloud/speech-to-text-code-pattern","owner":"watson-developer-cloud","description":"React app using the Watson Speech to Text service to transform voice audio into written text.","archived":false,"fork":false,"pushed_at":"2023-05-07T19:04:38.000Z","size":17949,"stargazers_count":2,"open_issues_count":6,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T01:33:55.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watson-developer-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-17T18:29:44.000Z","updated_at":"2021-07-31T21:51:28.000Z","dependencies_parsed_at":"2024-11-10T11:38:14.819Z","dependency_job_id":null,"html_url":"https://github.com/watson-developer-cloud/speech-to-text-code-pattern","commit_stats":null,"previous_names":[],"tags_count":3,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fspeech-to-text-code-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fspeech-to-text-code-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fspeech-to-text-code-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson-developer-cloud%2Fspeech-to-text-code-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson-developer-cloud","download_url":"https://codeload.github.com/watson-developer-cloud/speech-to-text-code-pattern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250583084,"owners_count":21453961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T11:27:35.245Z","updated_at":"2025-04-24T07:32:45.713Z","avatar_url":"https://github.com/watson-developer-cloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 style=\"font-weight: bold;\"\u003e# DEPRECATED\u003c/h1\u003e\n\u003ch2\u003e\n  This code pattern and repo is no longer supported. You can find the newly supported Speech to Text Code Pattern\n  \u003ca href=\"https://github.com/IBM/speech-to-text-code-pattern\"\u003e\n    here.\n  \u003c/a\u003e\n\u003c/h2\u003e\n\u003ch1 align=\"center\" style=\"border-bottom: none;\"\u003eSpeech to Text Code Pattern 🗣\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eSample React app for playing around with the Watson Speech to Text service.\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://travis-ci.org/watson-developer-cloud/speech-to-text-code-pattern\"\u003e\n    \u003cimg alt=\"Travis\" src=\"https://travis-ci.org/watson-developer-cloud/speech-to-text-code-pattern.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#badge\"\u003e\n    \u003cimg alt=\"semantic-release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c/p\u003e\n\n✨ **Demo:** https://speech-to-text-code-pattern.ng.bluemix.net/ ✨\n\n## Flow\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"architecture\" width=\"600\" src=\"./public/architecture.png\"\u003e\n\u003c/p\u003e\n\n1. User supplies an audio input to the application (running locally, in the IBM Cloud or in IBM Cloud Pak for Data).\n1. The application sends the audio data to the Watson Speech to Text service through a [WebSocket connection](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-websockets).\n1. As the data is processed, the Speech to Text service returns information about extracted text and other metadata to the application to display.\n\n## Prerequisites\n\n1. Sign up for an [IBM Cloud account](https://console.bluemix.net/registration/).\n1. Download the [IBM Cloud CLI](https://console.bluemix.net/docs/cli/index.html#overview).\n1. Create an instance of the Speech to Text service and get your credentials:\n   - Go to the [Speech to Text](https://console.bluemix.net/catalog/services/speech-to-text) page in the IBM Cloud Catalog.\n   - Log in to your IBM Cloud account.\n   - Click **Create**.\n   - Click **Show** to view the service credentials.\n   - Copy the `apikey` value.\n   - Copy the `url` value.\n\n### Cloud Pak for Data\n\nTo use this code pattern with a Speech to Text instance provisioned on Cloud Pak for Data, you can use your CPD `username` and `password` credentials or an `access_token` to authenticate your requests. You also need the service `url` as described [here](https://cloud.ibm.com/apidocs/speech-to-text/speech-to-text-data#authentication).\n\nAnother important thing to note is that this code pattern assumes that you're using a **valid SSL certificate** for your CPD cluster. If not, you'll receive transcription errors. If you'd still like to use the app with an invalid certificate, you'll need to look up your browser-specific way to ignore these certificate errors. Do note that this is very insecure though!\n\n## Configuring the application\n\nDepending on where your service instance is you may have different ways to download the credentials file.\n\n\u003e Need more information? See the [authentication wiki](https://github.com/IBM/node-sdk-core/blob/master/Authentication.md).\n\n### Automatically\n\nCopy the credential file to the application folder.\n\n**Cloud Pak for Data**\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"CPD\"  width=\"600\" src=\"https://watson-developer-cloud.github.io/images/credentials-cpd.png\"\u003e\n\u003c/p\u003e\n\n**Public Cloud**\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"public\"  width=\"600\" src=\"https://watson-developer-cloud.github.io/images/credentials-public.png\"\u003e\n\u003c/p\u003e\n\n### Manually\n\n1. In the application folder, copy the `.env.example` file and create a file called `.env`:\n\n   ```\n   cp .env.example .env\n   ```\n\n2. Open the `.env` file and add the service credentials depending on your environment.\n\n   Example `.env` file that configures the `apikey` and `url` for a Speech to Text service instance hosted in the US South region:\n\n   ```\n   SPEECH_TO_TEXT_APIKEY=12345abcde\n   SPEECH_TO_TEXT_URL=https://stream.watsonplatform.net/speech-to-text/api\n   ```\n\n   - **CPD using username and password:** If your service instance is running in Cloud Pak for Data and you want to use `username` and `password` credentials, add the following variables to the `.env` file.\n\n     ```\n     SPEECH_TO_TEXT_USERNAME=admin\n     SPEECH_TO_TEXT_PASSWORD=password\n     SPEECH_TO_TEXT_URL=https://{cpd-url}:{cpd-port}/speech-to-text/api\n     ```\n\n   - **CPD using access token:** If your service instance is running in Cloud Pak for Data and you want to use the `access_token` from the service instance detail page, add the following:\n\n     ```\n     SPEECH_TO_TEXT_BEARER_TOKEN=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.ey...\n     SPEECH_TO_TEXT_URL=https://{cpd-url}:{cpd-port}/speech-to-text/api\n     ```\n\n## Running locally\n\n1. Install the dependencies\n\n   ```\n   npm install\n   ```\n\n1. Build the application\n\n   ```\n   npm run build\n   ```\n\n1. Run the application\n\n   ```\n   npm run dev\n   ```\n\n1. View the application in a browser at `localhost:3000`\n\n## Deploying to IBM Cloud as a Cloud Foundry Application\n\nClick on the button below to deploy this demo to the IBM Cloud.\n\n[![Deploy to IBM Cloud](https://cloud.ibm.com/devops/setup/deploy/button.png)](https://cloud.ibm.com/devops/setup/deploy?repository=https://github.com/watson-developer-cloud/speech-to-text-code-pattern)\n\n1. Build the application\n\n   ```\n   npm run build\n   ```\n\n1. Login to IBM Cloud with the [IBM Cloud CLI](https://console.bluemix.net/docs/cli/index.html#overview)\n\n   ```\n   ibmcloud login\n   ```\n\n1. Target a Cloud Foundry organization and space.\n\n   ```\n   ibmcloud target --cf\n   ```\n\n1. Edit the `manifest.yml` file. Change the **name** field to something unique. For example: `- name: my-app-name`.\n1. Deploy the application\n\n   ```\n   ibmcloud app push\n   ```\n\n1. View the application online at the app URL, for example: https://my-app-name.mybluemix.net\n\n## Tests\n\n#### Unit tests\n\nRun unit tests with:\n\n```\nnpm run test:components\n```\n\nSee the output for more info.\n\n#### Integration tests\n\nFirst you have to make sure your code is built:\n\n```\nnpm run build\n```\n\nThen run integration tests with:\n\n```\nnpm run test:integration\n```\n\n## Directory structure\n\n```none\n.\n├── app.js                      // Express routes\n├── config                      // Express configuration\n│   ├── error-handler.js\n│   ├── express.js\n│   └── security.js\n├── package.json\n├── public                      // Static resources\n├── server.js                   // Entry point\n├── test                        // Tests\n└── src                         // React client\n    └── index.js                // App entry point\n```\n\n## License\n\nThis sample code is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Open Source @ IBM\n\nFind more open source projects on the [IBM Github Page](http://ibm.github.io/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Fspeech-to-text-code-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson-developer-cloud%2Fspeech-to-text-code-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson-developer-cloud%2Fspeech-to-text-code-pattern/lists"}