Advice needed for parts to build a mini-speaker!

hello DVDdoug, thank you for your reply. Ideally for the function, the speaker would mute(decrease) from a certain volume to 0 gradually (and removing the hand would increase back to its original volume.) I am not too sure for the difference between a digital pot and a micro controller, but hey cool, I will check it out.

What happens at night?

lol. Yea I am aware there is would be flawed. I trying to keep it simple and use what I have to make it work(to show a working prototype), I might be substituting it with either a Infrared Obstacle Avoidance Sensor or QRE1113 Line Sensor Breakout - Analog.

https://evive.cc/wp-content/uploads/2017/11/IR-SENSOR1.jpg

https://d1s30lqb5dw36k.cloudfront.net/images/thumbnails/295/295/product/4/09453-01-M.jpg?t=1519089017