Skip to content

Voice Assistant

project-owner edited this page Jun 13, 2023 · 9 revisions

Introduction

A microphone should be connected to the player in order to use the Voice Assistant functionality.

The Voice Assistant functionality in the player is based on the Vosk framework. The main features of that framework include voice recognition support for many languages and offline mode.

The offline mode allows to use the Voice Assistant even when the player is not connected to the Internet. By default the player includes two voice models for English and German. A model for any other language supported by the player can be downloaded from the Vosk web site using the Configuration Web UI. The player should be connected to the Internet to download voice models. A model can be also downloaded manually and placed in the folder /home/pi/vosk-models.

Command Types

All Voice Commands supported by the player can be divided into the following types:

  • Mode Commands. These commands switch the player into the corresponding mode (radio, file, podcasts etc)
  • Playback Commands. The commands in this group handle the player playback (play, pause, next, previous, volume etc)
  • Screensaver Commands. These commands activate the corresponding screensaver. The main commands of this type are the names of the screensavers (clock, weather etc). There are also some alternative commands. For example the command 'what time is it now' will activate the Clock screensaver. The command 'show weather forecast' will activate the Weather screensaver.
  • Equalizer Commands. The commands of this type set the pre-defined equalizer profile (jazz, rock etc).
  • Navigation Commands. These commands serve navigation purposes (back, home etc). The command 'okay' can be used to exit from the current screensaver.
  • Control Commands. The commands in this group control the player (reboot, shutdown etc).
  • Play Commands. These commands allow to play different items (radio stations, files) using just one command.

Volume Commands

Volume can be changed using two types of commands:

  • Icremental/Decremetal commands. These commands allow to increase/decrease current volume by 10 units. For example to increase volume by 10 units the command 'volume up' can be used.
  • Absolute Volume commands. These commands can be used to set volume to particular value. For example the command 'volume thirty' will set volume to value 30.

Play Commands

The play commands currently support the playback of radio stations, files, collection discs and songs.

  • The following command can be used to play a particular radio station 'play station radio love live new york'. Where 'play station' is the command itself with the station name following the command. The player will search through all playlists for the specified station name 'radio live new york'. When it will find the station it will switch to the corresponding genre and start playing the station.

  • Here is the example of the command to play an audio file in a current directory 'file money'. The player will search through files in a current directory for the filename 'money'. If it will find such file it will start playing it. If your file name is in English but your voice commands are in different language then you can use the property 'Translate Names' in the Voice Assistant configuration. That property allows to translate filenames into English. The player should be connected to the Internet for this functionality as it's using the Google translation framework. For example for the German command 'datei geld' the player will translate 'geld' into 'money' and search for the file with this name for example Money.flac.

  • The player can also search through the Collection database for disc and song names. If it will find any disc or song matching the command it will start playing that disc or song. Here is the example of the command to play disc 'disc the dark side of the moon'. The following command can be used to play a song from the collection 'song money'. If the player will find several songs in the collection with the same name (for example the song Money by Pink Floyd and ABBA) it will start playing the first found song in the alphabetical order (the song by ABBA in this case).

The image below explains how the player leverages the Voice Assistant to find and play a disc from a Collection:

va-flow

Troubleshooting

The file logging in the player should be enabled in order to check that the player recognized your voice commands. The player logs to the file all voice commands recognized and unrecognized. This way it's possible to see if the command was successfully recognized by the player. The log file can be observed in the Web Configuration UI. Press the Refresh button to see the latest messages in the log file.

Some commands have alternative variant. Sometimes player cannot recognize one variant but can recognize the other one. For example if the player doesn't recognize the command 'radio' the alternative command 'play radio' can be used.

<<Previous | Next>>

Contents

Clone this wiki locally