Including keypad library removes sound from my piezo element I am using the keypad library to include keypad and input numbers. when a specific number is entered a sound must be made.
However when I input using the serial monitor , sound is working. But when I include keypad , it only inputs numbers but not sound.
Help please , how can I make both work?
Thanks.

#include &lt;Keypad.h&gt;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {12, 11, 10, 9}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8,7,6,5}; //connect to the column pinouts


Then I get the input from keypad and store as result

char guess = 'n';
 char keypressed = keypad.getKey();
  if (keypressed != NO_KEY) {
    char guess = keypressed;

in void loop, it get result(key from keypad) and must play it: Tried separate sketch it works. but with keypad only input is , not sound.

Serial.print("You guessed:");
      Serial.println(guess);
      result = checkYourself(guess);
      Serial.println(result);
      playSound(result);

check yourself takes in guess from keypad ,checks then returns as result.
play sound function works when tried in another sketch( sorry not posting too much code its very long)
I was able to solve it , piezo dissent work in pin 9 but works when connected to pin 13.