Comments (4)
Offline Voice Assistant (processtext)
Every 60 seconds this service records a five second audio clip, converts the audio clip to text locally on the edge device, finally having the host machine execute the command and speak the output.
Before you begin
Ensure that your system meets the following requirements:
- You have register and unregister by performing the steps in Installing the Horizon agent on your edge machine (https://www-03preprod.ibm.com/support/knowledgecenter/SSFKVV_3.2.1/devices/installing/adding_devices.html)
- You installed a USB sound card and microphone (development was done with a standard headphone/microphone set) to your Raspberry Pi.
Registering your edge device
To run the processtext service example on your edge node, you must register your edge node with the IBM/pattern-ibm.processtext deployment pattern. Perform the steps in the Using the Offline Voice Assistant Example Edge Service with Deployment Pattern (https://github.com/open-horizon/examples/tree/master/edge/services/processtext#-using-the-offline-voice-assistant-example-edge-service-with-deployment-pattern) section of the readme file.
Additional information
The processtect example source code is also available in the Horizon GitHub repository as an example for IBM Edge Computing for Devices development. This source includes the code for all of the four services that run on the edge nodes for this example.
These services include:
- The voice2audio (https://github.com/open-horizon/examples/tree/master/edge/services/voice2audio) service which records the five second audio clip and publishes it to the mqtt broker
- The audio2text (https://github.com/open-horizon/examples/tree/master/edge/services/audio2text) service that takes the audio clip and converts it to text offline using pocket sphinx
- The processtext (https://github.com/open-horizon/examples/tree/master/edge/services/processtext) service will take the text and attempt to execute the recorded command
- The text2speech (https://github.com/open-horizon/examples/tree/master/edge/services/text2speech) service which will play the output of the command through a speaker
- Finally the mqtt_broker (https://github.com/open-horizon/examples/tree/master/edge/services/mqtt_broker) which is responsible for all inter-container communication
What to do next
For instructions on Building and Publishing Your Own Version of the Watson Speech to Text to IBM Event Streams Service (https://github.com/open-horizon/examples/blob/master/edge/services/processtext/CreateService.md#-building-and-publishing-your-own-version-of-the-offline-voice-assistant-edge-service) follow the steps in the processtext directory of the Open Horizon examples repository.
from examples.
Watson Speech to Text to IBM Event Streams Service (watsons2text)
This service listens for the hot word "Watson," once detected it captures an audio clip that is sent to an instance of Speech to Text, optionally removing stop words, then the transcribed text is send to IBM Event Streams.
Before you begin
Ensure that your system meets the following requirements:
- You have register and unregister by performing the steps in Installing the Horizon agent on your edge machine (https://www-03preprod.ibm.com/support/knowledgecenter/SSFKVV_3.2.1/devices/installing/adding_devices.html)
- You installed a USB sound card and microphone (development was done with a standard headphone/microphone set) to your Raspberry Pi.
This service requires both an instance of IBM Event Streams and IBM Speech to Text to run correctly. For instructions on how to deploy an instance of event streams see the Host CPU load percentage (https://www.ibm.com/support/knowledgecenter/SSFKVV_3.2.1/devices/installing/cpu_load_example.html) example.
Ensure the necessary IBM Event Stream environment variables are set:
echo "$EVTSTREAMS_API_KEY, $EVTSTREAMS_BROKER_URL"
The Event Streams topic this sample uses is myeventstreams
by default. Though you can use any topic by setting the following environment variable:
export EVTSTREAMS_TOPIC=<your-topic-name>
Deploying an instance of IBM Speech to Text
If an instance is currently deployed, obtain the access information and set the environment variables, or follow the steps below.
- Navigate to the IBM Cloud.
- Click Create resource.
- Enter
Speech to Text
in the search box. - Select the Speech to Text tile.
- Select a location, select a pricing plan, enter a service name, and click Create to provision the instance.
- After provisioning is complete, click the instance and note the credentials API Key and URL and export them as the following environment variables:
export STT_IAM_APIKEY=<speech-to-text-api-key>
export STT_URL=<speech-to-text-url>
- Go to the Getting Started section for instructions of how to test the Speech to Text service.
Registering your edge device
To run the watsons2text service example on your edge node, you must register your edge node with the IBM/pattern-ibm.watsons2text-arm deployment pattern. Perform the steps in the Perform the steps in the Using the Watson Speech to Text to IBM Event Streams Service with Deployment Pattern (https://github.com/open-horizon/examples/tree/master/edge/evtstreams/watson_speech2text#-using-the-ibm-watson-speech-to-text-to-ibm-event-streams-service-with-deployment-pattern) section of the readme file.
Additional information
The processtect example source code is also available in the Horizon GitHub repository as an example for IBM Edge Computing for Devices development. This source includes the code for all of the four services that run on the edge nodes for this example.
These services include:
- The hotworddetect (https://github.com/open-horizon/examples/tree/master/edge/services/hotword_detection) service listens for the hot word "Watson," once detected it will record a clip of audio and publish it to the mqtt broker.
- The watsons2text (https://github.com/open-horizon/examples/tree/master/edge/evtstreams/watson_speech2text) service receives an audio clip and sends it to the IBM Speech to Text service and publishes the deciphered text to the mqtt broker
- The stopwordremoval (https://github.com/open-horizon/examples/tree/master/edge/services/stopword_removal) service runs as a WSGI server that can take a JSON object such as {"text": "how are you today"} and will remove common stop words and return {"result": "how you today"}.
- The mqtt2kafka (https://github.com/open-horizon/examples/tree/master/edge/services/mqtt2kafka) service publishes data to IBM Event Streams when it receives something on the mqtt topic it's subscribed to.
- Finally the mqtt_broker (https://github.com/open-horizon/examples/tree/master/edge/services/mqtt_broker) which is responsible for all inter-container communication.
What to do next
For instructions on Building and Publishing Your Own Version of the Offline Voice Assistant Edge Service (https://github.com/open-horizon/examples/blob/master/edge/evtstreams/watson_speech2text/CreateService.md#-building-and-publishing-your-own-version-of-the-watson-speech-to-text-to-ibm-event-streams-service) follow the steps in the watson_speech2text directory of the Open Horizon examples repository.
from examples.
Doc part of this issue were reviewed and approved by Troy 11/20 for 3.2.1 - https://www-03preprod.ibm.com/support/knowledgecenter/SSFKVV_3.2.1/devices/installing/offline_voice_assistant.html and https://www-03preprod.ibm.com/support/knowledgecenter/SSFKVV_3.2.1/devices/installing/watson_speech.html
from examples.
Verified
from examples.
Related Issues (20)
- Feature Request: Operator Related Examples
- Documentation📄: https://github.com/open-horizon/examples/blob/master/edge/evtstreams/cpu2evtstreams/PolicyRegister.md#deployment-policy HOT 5
- CPU_PERCENT and GPS examples do not expose port HOT 12
- cpu_percent: aarch64/alpine docker container deprecated
- gps: aarch64/alpine docker container has been deprecated HOT 2
- Feature Request: helloworld - Converge on one Dockerfile
- Feature Request: helloMMS Converge on one Dockerfile HOT 4
- Feature Request: helloSecretWorld - Converge on one Dockerfile HOT 6
- Feature Request: mqttbroker Converge on one Dockerfile HOT 2
- Documentation📄: Outdated supported versions in README.md HOT 2
- Feature Request: Only build/push modified examples with GitHub action HOT 1
- Documentation📄: Move the SDR docs into the SDR directory HOT 1
- Documentation📄: operator example formatting issues HOT 1
- Add multi-arch support to Nginx-Operator example service
- Feature Request: Converge riscv on one Dockerfile
- Migrate fft_client and fft_server services to the open-horizon-services project
- Feature Request: Add s390x support for helloworld service
- Feature Request: Add release management workflow to Examples
- Feature Request: Modify helloSecretWorld to work with Open Bao HOT 1
- Feature Request: Modify GitHub action to push modified examples to the openhorizon docker hub
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examples.