Update sound.js

add type detect for `id[i]`, otherwise the line `coin: "sounds/coin.mp3` in example want work!