To run the Picovoice demo on Android or iOS with Flutter, you must have the Flutter SDK installed on your system. Once installed, you can run flutter doctor
to determine any other missing requirements for your relevant platform. Once your environment has been set up, launch a simulator or connect an Android/iOS device.
Before launching the app, use the copy_assets.sh script to copy the Picovoice demo assets into the demo project. (NOTE: on Windows, Git Bash or another bash shell is required, or you will have to manually copy the context into the project.).
Run the following command from demo/flutter to build and deploy the demo to your device:
flutter run
For this demo, the default wake word is Picovoice
and the context is Smart Lighting
. Simply press start and the engine can recognize commands such as
Picovoice, turn off the lights.
or
Picovoice, set the lights in the bedroom to blue.
See below for the full context:
context:
expressions:
changeColor:
- "[turn, make] (all, the) lights $color:color"
- "[change, set, switch] (all, the) lights to $color:color"
- "[turn, make] (the) $location:location (color, light, lights) $color:color"
- "[change, set, switch] (the) $location:location (color, light, lights) to $color:color"
- "[turn, make] (the) [color, light, lights] [at, in] (the) $location:location $color:color"
- "[change, set, switch] (the) [color, light, lights] [at, in] (the) $location:location to $color:color"
- "[turn, make] (the) [color, light, lights] $color:color [at, in] (the) $location:location"
- "[change, set, switch] (the) [color, light, lights] to $color:color [at, in] (the) $location:location"
changeLightState:
- "[switch, turn] $state:state (all, the) lights"
- "[switch, turn] (all, the) lights $state:state"
- "[switch, turn] $state:state (the) $location:location (light, lights)"
- "[switch, turn] (the) $location:location [light, lights] $state:state"
- "[switch, turn] $state:state (the) [light, lights] [at, in] (the) $location:location"
- "[switch, turn] (the) [light, lights] [in, at] the $location:location $state:state"
changeLightStateOff:
- "shut off (all, the) lights"
- "shut (all, the) lights off"
- "shut off (the) $location:location (light, lights)"
- "shut (the) $location:location (light, lights) off"
- "shut off (the) [light, lights] [at, in] (the) $location:location"
- "shut (the) [light, lights] off [at, in] (the) $location:location"
- "shut (the) [light, lights] [at, in] (the) $location:location off"
slots:
color:
- "blue"
- "green"
- "orange"
- "pink"
- "purple"
- "red"
- "white"
- "yellow"
state:
- "off"
- "on"
location:
- "bathroom"
- "bedroom"
- "closet"
- "hallway"
- "kitchen"
- "living room"
- "pantry"