File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
workspaces/simon-game/src/app Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 11export const config = {
22 soundDurationMs : 300 ,
33 volumePct : 0.1 ,
4- buttons : [
4+ boxes : [
55 {
66 color : "red" ,
77 frequency : 261.63 ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ let audioContext: AudioContext | null = null;
66 * @param context - The audio context to use for generating the sound.
77 * @param frequency - The frequency of the sound in Hertz
88 * @param durationMs - The duration of the sound in milliseconds.
9- * @param volume - The volume of the sound, typically between 0 and 1.
9+ * @param volumePct - The volume of the sound, typically between 0 and 1.
1010 */
1111export const playSound = (
1212 frequency : number ,
@@ -34,10 +34,7 @@ export const playSound = (
3434 gainNode . gain . setValueAtTime ( volumePct , audioContext . currentTime ) ;
3535
3636 // Creates the smooth fades-in / fade-out sound effect (Avoids the popping sounds)
37- gainNode . gain . linearRampToValueAtTime (
38- volumePct ,
39- audioContext . currentTime + 0.01 ,
40- ) ;
37+ gainNode . gain . linearRampToValueAtTime ( volumePct , audioContext . currentTime + 0.01 ) ;
4138 gainNode . gain . linearRampToValueAtTime (
4239 0 ,
4340 audioContext . currentTime + durationMs / 1000 - 0.01 ,
You can’t perform that action at this time.
0 commit comments