Skip to content

Commit

Permalink
Add new sound for keyboard presses
Browse files Browse the repository at this point in the history
It's "Keyboard Key with Pitch and Phaser Effects by AntoineRomo --
https://freesound.org/s/592765/ -- License: Attribution 3.0"
  • Loading branch information
svillar committed Feb 24, 2025
1 parent daaa1d5 commit 4c229dd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum Sound {
BACK,
EXIT,
ERROR,
KEYBOARD,
AMBIENT(SoundType.FIELD);

private SoundType mType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public String getPath(AudioEngine.Sound aSound) {

private String filename(AudioEngine.Sound aSound) {
switch (aSound) {
case KEYBOARD: return "keyboard_sound.wav";
case CLICK: return "click.wav";
case BACK: return "back.wav";
case EXIT: return "exit.wav";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ private void handleKey(int primaryCode, int[] keyCodes) {
if (mKeyboardView.isShifted() && Character.isLowerCase(str.charAt(0))) {
str = str.toUpperCase();
}
mAudioEngine.playSound(AudioEngine.Sound.CLICK);
mAudioEngine.playSound(AudioEngine.Sound.KEYBOARD);
handleText(str);
}

Expand Down
Binary file added app/src/main/assets/sounds/keyboard_sound.wav
Binary file not shown.

0 comments on commit 4c229dd

Please sign in to comment.