Da forma que eu vejo o meu codigo deveria funcionar. Alguem sabe por que nao funciona?
Abracos!
const botoes = document.querySelectorAll(".tecla");
const audios = document.querySelectorAll("audio");
function tocaSom(i){
    audios[i].play();
};  
for(i=0; i<botoes.length; i++){
   botoes[i].onclick = function(){
      tocaSom(i);
   }
};O erro que da eh:
main.js:6 Uncaught TypeError: Cannot read properties of undefined (reading 'play') at tocaSom (main.js:6:15) at botoes..onclick (main.js:14:7)
 
            