andyvn22 / rhythm-game

A browser game that teaches you to read music! Real sheet music!
1 stars 1 forks source link

Use microphone for real claps and taps? #1

Open hallvors opened 2 years ago

hallvors commented 2 years ago

Hi @andyvn22, fun little thing you've made here :+1:

Have you considered requesting access to the user's microphone to let the game support real claps and taps?

(Naturally raises the question of how to distinguish "claps" and "taps" and background noise in code.. Should be a bit of a challenge but doable.)

hallvors commented 2 years ago

(I'm actually looking for something a group can play together - a single screen, all clapping. Although I find your space+enter keys solution clever and suprisingly engaging, I think a microphone mode would be fun too)

andyvn22 commented 2 years ago

Yeah, this would be fantastic. If possible, the microphone should also be checking counts, which are currently ignored and just referenced repeatedly in the instructions. (I can say from experience that currently, many students try to play without counting, and that many of them end up stuck as a result!)

hallvors commented 2 years ago

Great point, although complicated :) Even distinguishing "claps" from "taps" is going to be a bit complicated since you'd need to decide a volume threshold or something.. and it's definitely non-trivial to detect if the right number is spoken :)