Wido Wirsam
Published © GPL3+

Voice Controlled Slider Projector

Old tech meets high tech. Windows 10 UWP App with speech recognizion controlls an old slide projector.

IntermediateFull instructions provided3,279

Things used in this project

Hardware components

Slide projector
Get a used one on the flee market or thrift shop.
×1
Raspberry Pi 2 Model B
Raspberry Pi 2 Model B
×1
Relay 2 channel
×1
Usb microphone
×1

Software apps and online services

Windows 10 IoT Core
Microsoft Windows 10 IoT Core

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Speech recognition snippet

C#
 if (recognizer == null)

{

recognizer = new SpeechRecognizer();

var languages = SpeechRecognizer.SupportedGrammarLanguages;

var SysSpeech = SpeechRecognizer.SystemSpeechLanguage;

}

string[] possibleAnswers = { "Light on", "Light off", "on", "off", "light", "dark", "bright", "next", "previous", "forward", "back", "slideshow", "stop" };

var listConstraint = new SpeechRecognitionListConstraint(possibleAnswers, "Answer");

recognizer.Constraints.Add(listConstraint);

listenText.Text = recognizer.CurrentLanguage.DisplayName;

await recognizer.CompileConstraintsAsync();

recognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;

recognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;

await recognizer.ContinuousRecognitionSession.StartAsync();

GPIO/relays controlling:

C#
private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)
        {
            SpeechRecognitionResult tmpRes = args.Result;
            if (tmpRes != null && tmpRes.Status.Equals(SpeechRecognitionResultStatus.Success))
            {
// some less relevant code removed
                  listenText.Text = tmpRes.Text;
                  if (!slideshow)
                  {
                      if (listenText.Text.Equals("Light on") || listenText.Text.Equals("on") || listenText.Text.Equals("light") || listenText.Text.Equals("bright"))
                      {
                          lightPinValue = GpioPinValue.Low;
                          lightPin.Write(lightPinValue);
                          LED.Fill = redBrush;
                          lightOn = true;
                      }

Complete UWP Project code

For a quick and happy compile and deploy experience.

Credits

Wido Wirsam

Wido Wirsam

2 projects • 10 followers

Comments