chessboardjsx icon indicating copy to clipboard operation
chessboardjsx copied to clipboard

adding sound effect

Open moblizeit opened this issue 4 years ago • 2 comments

is there a way to add sound when pieces are moved on the board?

moblizeit avatar Apr 06 '21 03:04 moblizeit

You could just check to see if the previous position is not equal to the current position. If so, add a sound effect and adjust the timing of it with setTimeout. You can use lodash's isEqual() to check if the two position objects are the same

willb335 avatar Apr 06 '21 20:04 willb335

sorry my question was actually how to add sound effects rather how to detect where to add it.

moblizeit avatar Apr 07 '21 03:04 moblizeit