Ask for something and get back answers. This is what we want from our Linino One in this example.
Depending on the voice request, we will get a proper response, made available by Wolfram Alpha site.
Everything we need:
Let’s start by installing the necessary interface to our board with the USB sound card.
We access in SSH mode in Linino board, we write from Terminal
ssh root@linino.local
by inserting the password and obtained the necessary permits, we’ll see when it follows:
Now, always in the SSH shell, we give the following commands:
opkg update
opkg install --force-depends kmod-usb-audio
opkg install madplay d mnt
Now that we have configured the sound card, close the SSH connection with the board and move on to the code.
Open a new project in Ideino Workspace (we have called WolframAlpha).
In package.json insert the file dependency to the module xml-mapping.
Save and install.
The code in the javascript file will be:
Now, we build the application for Android.
Connect to the site of App Inventor (http://appinventor.mit.edu/explore/). Click on Create and begin to build our project (see figure).
Customize our graphical user interface, the button Ask, will serve to give voice commands.
In Block screen, we associate a URL with a specific string, then it will be our Server, started on the board, to interpret the command.
NB. instead of IP in the image, enter the local IP address of your board.
The ASK button is associated with the function SpeechRecognizer that converts voice into text, using the Speech from Google.
Here attached the project WolframAlphaAsk for App Inventor.
After the construction of the App is now time to try it on.
Install and start, in your Andorid device, the app MIT App Inventor 2. Return to the App Inventor site, click at the top of Connect-> AI Companion and this screen will appear:
From the app on your smartphone Click on “Scan QR code” and retrieved the code “Connect with tails.”
At this point you start the app on your Android device.
Start app.js in your project Ideino, clickate the Ask button in the app Android and try to ask any question to the mastermind of Wolfram Alpha.
Comments
Please log in or sign up to comment.