Audio only working 50%

I have a function that would make sound for walking left and right.
**|Column 1 | Column 2 | Column 3 | Column 4|
**
**|— | — | — | —|
**
**| | What happens | Expect this to happen | pass|
**
**|SHIFT then A | plays running noise | plays running noise | CORRECT|
**
**|A and then SHIFT | stops walking noise then plays running | stops walking noise then plays running | CORRECT|
**
**|A | plays walking noise | plays walking noise | CORRECT|
**
**|A and UNSHIFT | stops running noise | stops running noise then plays walking | CORRECT|
**
**|A and then UNPRESS A | stops walking noise | stops walking noise | CORRECT|
**
its all fine until i try to test it with the D keys.

heres the project

@azurirou ,

I added some console.log statements to see what was happening and as I expected, if you use the d key, your logic is asking it to play two sounds at once and I think that is why it sounds so bad.

Here’s a link to my version. If you press ‘D’ and monitor the console, you will see that it is playing both messages (hence both sounds).

Mike

1 Like