Jump to content
LaunchBox Community Forums

Big Box Voice Search 0.0.4

   (0 reviews)

3 Screenshots

About This File

BigBoxVoiceSearch
BigBoxVoiceSearch is a plug-in for BigBox that enables searching for games using your voice and a microphone via microsoft's speech recognition.  To make use of this plug-in, the plug-in components must be installed to the LaunchBox plugins folder and a few lines of XAML code must be added to the themes where you wish to use it.
 

Demo

Installation
1.  Download the latest version of BigBoxVoiceSearch.zip from the LaunchBox forums or from this github repositories Releases
2.  Extract BigBoxVoiceSearch.zip to a folder.  Inside the BigBoxVoiceSearch folder is a folder called LaunchBox.  Inside the LaunchBox folder is a folder called Plugins.  Copy the plugins folder
3.  Go to your LaunchBox installation folder and paste the copied folder
4.  To verify the installation - confirm the following files exist in your LaunchBox\Plugins folder
  - BigBoxVoiceSearch.dll
  - System.Speech.dll    
5.  You can delete the downloaded zip file and extracted folder once the files have been copied into your LaunchBox plugins folder

Adding the voice search element to a theme
In order to use the voice recognition function, a few lines of XAML must be added to the views of the themes that you would like to use this with.  Since it's easy to make simple mistakes while tinkering with XAML, it's strongly recommended to make a copy of whatever theme you plan to use this with and make your changes to a copy of the theme so that you can revert to the original theme if mistakes are made.  Inside your copied theme there is a views folder.  Inside the views folder are xaml files that correspond to the views that you use in BigBox.  Select the view(s) for which you wish to include voice searching functionality and edit them in a text editor like notepad or visual studio.

XMLNS
Each view starts with a UserControl element.  The user control element will include several lines that start with xmlns.  Add the following line to the user control element along with the other xmlns lines.  

xmlns:BigBoxVoiceSearch="clr-namespace:BigBoxVoiceSearch.View;assembly=BigBoxVoiceSearch"

Examples of adding the voice search user control to a theme

Once the above XMLNS line has been added to a views user control element, you can add the BigBoxVoiceSearch:MainWindowView anywhere inside the theme that you would like it to appear.  There are a few properties that you can set on the voice search control to specify how it should behave.  First, here are some examples of how it would look to add the voice search control inside a theme:

<!-- Trigger voice recognition with page up, the control is always displayed -->
<BigBoxVoiceSearch:MainWindowView ActivationMode="PageUp" 
                                  ShowInitializing="true"
                                  ShowInitializingFailed="true"
                                  ShowInactive="true"
                                  ShowActive="true"
                                  ShowRecognizing="true"/>

 

<!-- Trigger voice recognition with page down, the control is only displayed while recognizing -->
<BigBoxVoiceSearch:MainWindowView ActivationMode="PageDown" 
                                  ShowInitializing="false"
                                  ShowInitializingFailed="false"
                                  ShowInactive="false"
                                  ShowActive="false"
                                  ShowRecognizing="true"/>

 

<!-- Activate the user control with Up - you will need to press enter to trigger the voice search, the control is always displayed --> 
<BigBoxVoiceSearch:MainWindowView ActivationMode="Up" 
                                  ShowInitializing="true"
                                  ShowInitializingFailed="true"
                                  ShowInactive="true"
                                  ShowActive="true"
                                  ShowRecognizing="true"/>

 

<!-- Trigger voice recognition with page up, the control is always displayed, override default images with theme specific images -->
<BigBoxVoiceSearch:MainWindowView ActivationMode="PageUp"
  ShowInitializing="true" InitializingImagePath="Plugins\BigBoxVoiceSearch\Media\MySpecialTheme\Initializing.png"
  ShowInitializingFailed="true" InitializingFailedImagePath="Plugins\BigBoxVoiceSearch\Media\MySpecialTheme\InitializingFailed.png"
  ShowInactive="true" InactiveImagePath="Plugins\BigBoxVoiceSearch\Media\MySpecialTheme\Inactive.png"        
  ShowRecognizing="true" RecognizingImagePath="Plugins\BigBoxVoiceSearch\Media\MySpecialTheme\Recognizing.png"/>

 

ActivationMode
By specifying the ActivationMode property on the voice search user control, you can control how the voice search control is activated and how the voice search is triggered with the following options: 

  • Off
    • The plug-in is effectively disabled
    • No button will activate the user control or trigger speech recognition
  • Up
    • The up button will activate the user control
    • The down button will deactivate the user control 
    • Once activated, press enter to start speech recognition
  • Down
    • The down button will activate the user control
    • The up button will deactivate the user control 
    • Once activated, press enter to start speech recognition
  • Left
    • The left button will activate the user control
    • The right button will deactivate the user control 
    • Once activated, press enter to start speech recognition
  • Right
    • The right button will activate the user control
    • The left button will deactivate the user control 
    • Once activated, press enter to start speech recognition
  • PageUp
    • The page up button will trigger voice recognition immediately
    • You do not need to press enter after pressing Page Up
    • You do not need to press any button to deactivate the user control
  • PageDown
    • The page down button will trigger voice recognition immediately
    • You do not need to press enter after pressing Page Down
    • You do not need to press any button to deactivate the user control

VisibilityMode 
The VisibilityMode property from previous versions has been replaced with individual boolean properties ShowInitializing, ShowInitializingFailed, ShowInactive, ShowActive, and ShowRecognizing.

ShowInitializing
The ShowInitializing property accepts the values "true" or "false" to indicate whether the user control should be displayed while initializing.  When the view is loaded, there is an intialization period where the titles in the launchbox game library are parsed to create the speech recognition grammar.  Setting this property to true can give a visual indication that the speech recognition functionality is not yet ready to use.  This property defaults to false if not specified on the UserControl.  
  
ShowInitializingFailed
The ShowInitializingFailed property accepts the values "true" or "false" to indicate whether the user control should be displayed if initialization fails.  Failures could occur while the user control is initializing if there is no default audio device for the speech recognition engine to use.  Setting this property to true can give the indication that speech recognition was not setup successfully and is therefore disabled.  If errors are encountered, check the log.txt file in the LaunchBox\Plugins\BigBoxVoiceSearch folder for any error details.  This property defaults to false if not specified on the UserControl.  

ShowInactive
The ShowInactive property accepts the values "true" or "false" to indicate whether the user control should be displayed while it is inactive.  The user control will be inactive after initialization completes successfully.  Setting this property to true can give the indication that speech recognition is setup and available to use.  The property defaults to false if not specified on the UserControl.  

ShowActive
The ShowActive property accepts the values "true" or "false" to indicate whether the user control should be displayed while it is active.  The user control is put in an active state when you press Up, Down, Left, or Right and the ActivationMode property is set to Up, Down, Left, or Right.  Setting this property to true can give the indication that the speech recognition user control is active and will perform a search of enter is pressed.  The property defaults to false if not specified on the UserControl.  

ShowRecognizing
The ShowRecognizing property accepts the values "true" or "false" to indicates whether the usr control should be displayed while recognizing speech.  The user control recognizes speech when you press Page Up or Page Down and the ActivationMode is set to PageUp or PageDown or when you press Enter while the speech recognition user control is active (if ActivationMode set to Up, Down, Left, or Right).  The property defaults to false if not specified on the UserControl.

Default image paths 
If no custom image paths are specified on the user control, the plugin will look for images with the following path to display in various states: 

| State              | Default image path                                                          |
|--------------------|-----------------------------------------------------------------------------|
| Initializing       | ..\LaunchBox\Plugins\BigBoxVoiceSearch\Media\Default\Initializing.png       |
| InitializingFailed | ..\LaunchBox\Plugins\BigBoxVoiceSearch\Media\Default\InitializingFailed.png |
| Inactive           | ..\LaunchBox\Plugins\BigBoxVoiceSearch\Media\Default\Inactive.png           |
| Active             | ..\LaunchBox\Plugins\BigBoxVoiceSearch\Media\Default\Active.png             |
| Recognizing        | ..\LaunchBox\Plugins\BigBoxVoiceSearch\Media\Default\Recognizing.png        |

 

 

Custom image paths 
Images displayed by the user control can be overridden or customized by specifying a relative path to the image file on the user control with the following properties: 
- InitializingImagePath
- InitializingFailedImagePath
- InactiveImagePath
- ActiveImagePath
- RecognizingImagePath

Settings

When BigBox loads for the first time, a settings file will be created that will allow you specify how the plugin should behave.  Currently there is only one setting to configure 

{
  "VoiceSearchTimeoutInSeconds": 5
}

VoiceSearchTimeoutInSeconds
Specify the number of seconds that the voice search should stay open before it stops listening

Link to GitHub repo

https://github.com/AtomFry/BigBoxVoiceSearch

 

Edited by Fry
Updates for version 0.0.3


What's New in Version 0.0.4   See changelog

Released

Minor improvements/fixes

 

  • Replace double quotes with spaces when creating voice search grammar as double quotes are not supported and cause it to fail.
  • Added settings to specify whether you want to log debug messages or errors
  • Does not call the launchbox search any longer if no matches are found
  • Like 5
  • Unusual Gem 3

User Feedback

Recommended Comments

2 hours ago, KaaMoS said:

Great tool! :)
This must be added as a feature to LB/BB itself. 

Thanks!  I think this feature was actually there in LB/BB but got removed a few years back.  These things never work perfectly and I can imagine the development team not wanting to support this feature since it's finicky and not that popular in the first place.  I'd love to see them pick it up and make it a first class citizen and we can get rid of this plug-in but I don't think it will be high on anyone's priority list.  

  • Thanks 1
Link to comment
Share on other sites

I’m still not settled with the design of this plugin and will work on an update to make it a little bit more theme friendly. My thought is to add some additional properties for override paths to images that the plugin displays so that they can be changed on a theme by theme basis. Currently you are stuck with one set of images so if you make a change to an image then it will impact all themes that use the plugin. Different themes should be able to look different independently of other themes. To achieve this I will add properties to the voice search user control to allow you to specify an override path to the image that is displayed. These will be optional and the images will fall back to the default image paths if none are specified on the user control. 

I am also looking at the initialization process and thinking to refactor it to be done in a background thread. On my old laptop it takes less than 1/2 a second to load and I cannot notice any performance impact from the plugin but I also only have around 3000 games. I could imagine people with larger collections may see a little hiccup while a theme loads the plugin and generates the speech recognition grammar as that process does a lot of string manipulation on each game’s title to build the grammar. To solve this, the speech recognition initialization can be done in a background thread so that no impact on the theme should be felt regardless of collection size.  Loading in a background thread should allow me to bring back the animated GIF which I had previously removed due to slow loading performance. 

I’ll work on getting these enhancements out as time permits. 

Link to comment
Share on other sites

I do tons of home automation, For example, I have big screen hanging on the wall over one of my PCs. I just grab a DS4 controller, tell Alexa to change the TV for games, then tell Alexa to tell my PC to play games. The first voice command changes the TV to the appropriate HDMI input, the second voice command runs a couple programs on my PC to change the primary monitor to the TV and the PC audio to the surround sound and then run some apps like DS4Windows and Bigbox.

Couple questions or thoughts
1. Do you plan on expanding the plugin, like being able to do more than search, like actually starting a game?

2. Have you considered doing an Alexa skill to work with it? (Amazon is actually having a free seminar Jan.19th on how to use some of their new tools to add voice without coding experience to things like this if your interested)

I love this and hope you continue developing it!!!

  • Like 1
Link to comment
Share on other sites

I haven’t really considered Alexa, I’m just using Microsoft’s .NET speech recognition library for this. I did think about adding more features like having it always listening so you could say something like “hey big box, play Zelda” or something. I’m mostly interested in search to quickly find games. The voice search is pretty accurate but for me it isn’t accurate enough to launch directly into a game from a search. I like to have the search results as a nice intermediate step to make sure it found the right game. My next iteration on this project will be to improve the themability so that it can integrate seamlessly with any theme and look like it belongs there but I got a bit busy with work and family needs so it may be some time before I’m able to release any updates. The source is published on my GitHub if anyone wants to take a stab at modifying it. 

  • Like 1
Link to comment
Share on other sites

I wish they would just put it back into the native LB/BB with its default setting off, instead of completely removing it. Especially now when we have AI search coming, a lot of people are going to be using voice in 2023. This is cool, i just don't use Big Box unless I'm browsing games slowly anyway. I feel like the real utility would be in LB. Good work though, man. LMK if you can get this working for Launch Box.

  • Like 1
Link to comment
Share on other sites

A plug-in could be created that would trigger the voice search from a system menu item.  There's currently no way to bind a hotkey to a plug-in system menu item so it would have to be manually selected from the tools menu.  Clicking the menu item could trigger a voice search but there's no plug-in API available to search or filter LaunchBox.  A change would be needed to ILaunchBoxMainViewModel.  So I could either create a custom UI to display the matching games and let you launch them from there or just straight away launch the highest confidence match returned.  It would be doable but not really the best user experience.  The code for the big box voice search is out there and could be adapted as described above but I don't have a ton of interest in that because I mostly just use LaunchBox to manage my games to support my arcade cabinet so I mostly just use BigBox when I'm playing games.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...