alright so i figured it out. this block of code seems to work:
if (app.keyboard.wasPressed(pc.KEY_A)) {
this.entity.sound.play("walk");
}
if (app.keyboard.wasReleased(pc.KEY_A)) {
this.entity.sound.stop("walk");
}
if (app.keyboard.wasPressed(pc.KEY_D)) {
this.entity.sound.play("walk");
}
if (app.keyboard.wasReleased(pc.KEY_D)) {
this.entity.sound.stop("walk");
}
if (app.keyboard.wasPressed(pc.KEY_W)) {
this.entity.sound.play("walk");
}
if (app.keyboard.wasReleased(pc.KEY_W)) {
this.entity.sound.stop("walk");
}
if (app.keyboard.wasPressed(pc.KEY_S)) {
this.entity.sound.play("walk");
}
if (app.keyboard.wasReleased(pc.KEY_S)) {
this.entity.sound.stop("walk");
}