项目作者: hypeapps

项目描述 :
A voice controlled smart mirror powered by Raspberry Pi3 and AndroidThings.
高级语言: Java
项目地址: git://github.com/hypeapps/black-mirror.git
创建时间: 2017-04-02T12:26:11Z
项目社区:https://github.com/hypeapps/black-mirror

开源协议:MIT License

下载


Black Mirror

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.



Buy Me a Coffee at ko-fi.com

Commands

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.

  1. Showing/hiding weather widget:

    “Pokaż pogodę dla miasta (Lokalizacja)”

    “Zamknij widok pogody”

  2. Showing/hiding news widget.

    “Pokaż wiadomości ze świata”

    “Pokaz wiadomości z Polsatu”

    “Pokaż wiadomości z TVNu”

    “Zamknij widok wiadomości”

  3. Showing/hiding time widget.

    “Pokaż czas dla kraju (Lokalizacja)”

    “Zamknij/Ukryj zegar”

  4. Showing/hiding/changing calendar month.

    “Pokaż kalendarz”

    “Pokaż kolejny miesiąc”

    “Pokaż poprzedni miesiąc”

    “Zamknij widok kalendarza”

Setup

API keys

Paste your api keys in gradle.properties. You need to register in OpenWeatherMap, TimeZoneDb, GoogleGeoApi to obtain api keys. It’s completly free.

Google Cloud Speech Cloud Credentials

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

Keyword changing

If you want to change default keyword “wakeup mirror”, you should change line in PocketSphinx.java (line:24)

  1. private static final String ACTIVATION_KEYPHRASE = "wakeup mirror";

Language change

  1. Set your language code in SpeechService.java (line: 262)
    1. mRequestObserver.onNext(StreamingRecognizeRequest.newBuilder()
    2. .setStreamingConfig(StreamingRecognitionConfig.newBuilder()
    3. .setConfig(RecognitionConfig.newBuilder()
    4. // Change this line
    5. .setLanguageCode("pl-PL")
    6. .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16)
    7. .setSampleRateHertz(sampleRate)
    8. .build())
  2. Change all vocabularies in TextCommandInterpreter. For example:
    1. private final ArrayList<String> countryVocabulary = new ArrayList<>(Arrays.asList("kraj", "kraju", "krajowi", "krajom"));
    change to:
    1. private final ArrayList<String> countryVocabulary = new ArrayList<>(Arrays.asList("country", "countries", "land", "state"));

    Run on android smartphone

    Comment or delete this in AndroidManifest.xml
    1. <intent-filter>
    2. <action android:name="android.intent.action.MAIN"></action>
    3. <!-- Comment this <category android:name="android.intent.category.IOT_LAUNCHER"></category> -->
    4. <category android:name="android.intent.category.DEFAULT"></category>
    5. </intent-filter>

    Permissions

    You need to remember to grant permission via adb or android settings for:
    1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
    2. <uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>

    Pictures

    Welcome screen
    Welcome screen
    Welcome screen

    Video

    YouTube video

    Hardware

  • Raspberry Pi3
  • Anbes Super Mini New High-Quality Sound USB 2.0 Microphone Audio Adapter (works with AndroidThings out of the box)
  • Compaq 17’ 4:3 LCD Display

    License MIT

    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.