A voice controlled smart mirror powered by Raspberry Pi3 and AndroidThings.
A voice controlled smart mirror powered by Raspberry Pi3B+ and AndroidThings. Mirror is capable to display or hide widgets such as weather, news, time, calendar when the correct voice command is given.
At the moment Black Mirror supporting commands in polish language only. If you would like to change the language, see the setup section below. Mirror listen the command only after “wakeup mirror” keyword spotted, this action will be indicated by mic animation.
“Pokaż pogodę dla miasta (Lokalizacja)”
“Zamknij widok pogody”
“Pokaż wiadomości ze świata”
“Pokaz wiadomości z Polsatu”
“Pokaż wiadomości z TVNu”
“Zamknij widok wiadomości”
“Pokaż czas dla kraju (Lokalizacja)”
“Zamknij/Ukryj zegar”
“Pokaż kalendarz”
“Pokaż kolejny miesiąc”
“Pokaż poprzedni miesiąc”
“Zamknij widok kalendarza”
Paste your api keys in gradle.properties. You need to register in OpenWeatherMap, TimeZoneDb, GoogleGeoApi to obtain api keys. It’s completly free.
To work with google speech recognition you need credentials.json file placed in /res/raw directory.
More info at: https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech
If you want to change default keyword “wakeup mirror”, you should change line in PocketSphinx.java (line:24)
private static final String ACTIVATION_KEYPHRASE = "wakeup mirror";
mRequestObserver.onNext(StreamingRecognizeRequest.newBuilder()
.setStreamingConfig(StreamingRecognitionConfig.newBuilder()
.setConfig(RecognitionConfig.newBuilder()
// Change this line
.setLanguageCode("pl-PL")
.setEncoding(RecognitionConfig.AudioEncoding.LINEAR16)
.setSampleRateHertz(sampleRate)
.build())
change to:
private final ArrayList<String> countryVocabulary = new ArrayList<>(Arrays.asList("kraj", "kraju", "krajowi", "krajom"));
private final ArrayList<String> countryVocabulary = new ArrayList<>(Arrays.asList("country", "countries", "land", "state"));
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<!-- Comment this <category android:name="android.intent.category.IOT_LAUNCHER"></category> -->
<category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
MIT License
Copyright (c) 2017 Przemek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.