V

Voice Controlled Pacman

Voice Controlled Web-Based Rendition of Classic PACMAN using Speech Recognition and Javascript.

Created on 16th August 2021

V

Voice Controlled Pacman

Voice Controlled Web-Based Rendition of Classic PACMAN using Speech Recognition and Javascript.

The problem Voice Controlled Pacman solves

Voice-Controlled-Games-For-Persons-With-Disabilities

This is a project as part of the DevFest2.0 Hackathon organized by DevSoc Developers' Society,BITS Pilani,Goa Campus.

What Problems does it solve and Why?

Arcade hits like PACMAN have been enjoyed with touch and keyboard based controllers for a long time.

But Persons with disability haven't had a chance to enjoy these games to the fullest potential.
Hence the Solution of "Voice based Controller using Speech Recognition" to control games like PACMAN without the need of a keyboard or physical interaction with the Computer!

How does it solve the problem?

Web based PACMAN game which can be controleld using either "WASD" movement or Voice Commands such as:

"UP" for W

"LEFT" for A

"BOTTOM" for S

"RIGHT" for D

Where - Live Demo?

https://chandradharrao.github.io/Voice-Controlled-Games-For-Persons-With-Disabilities/Games/Pacman/src/index.html

TechStack used to solve the problem:

HTML,CSS for the Visuals.

Vanilla Javascript + HTML Canvas to implement the Game Engine.
No external libraries or framework.

Web Speech API inbuilt within Browsers to implement the Speech Recognition Engine.
Web Speech API abstracts the native Speech Recognition Module provided by different Operating Systems.

Samples

alt text

alt text

Future Work:

Add in more classic games like Pong and other popular games like Chrome T-Rex run.

Enhance Pacman with procedural maze generation and Advanced AI behavior.

Challenges I ran into

Implementing the game engine from scratch using javascript was a huge hurdle.

Javascript is easy to use but not fast especially with many game objects in the scene.

Hence I used object pooling to optimize the performance.

Setting up Web Speech API to work with continuous Speech recognition was also difficult due to the
new Google Voice Privacy Policy.

Running the Speech Recognition Engine along with the Game loop Solved the issue.

Mozilla MDN helped a lot through the project!

Discussion

Builders also viewed

See more projects on Devfolio