Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

398
Vistas
JavaScript play () de audio no funciona, TypeError: this.kickAudio.play no funciona?

this.kickAudio.play(); no esta jugando no se porque?? Por favor ayuda

Estoy tratando de reproducir el audio en bucle sobre el div, pero de alguna manera el archivo de audio no se reproduce

 class DrumKit { constructor() { this.pads = document.querySelectorAll(".pad"); this.playBtn = document.querySelector(".play"); this.kickAudio = document.querySelectorAll(".kick-sound"); this.snareAudio = document.querySelectorAll(".snare-sound"); this.hithatAudio = document.querySelectorAll(".hithat-sound"); this.index = 0; this.bpm = 150; } activePad() { this.classList.toggle("active"); } repeat() { let step = this.index % 8; const activeBars = document.querySelectorAll(`.b${step}`); console.log(step); // Looping over the pads for animation activeBars.forEach((bar) => { bar.style.animation = `playTrack 0.3s alternate ease-in-out 2`; // Check for the active pad if (bar.classList.contains("active")) { if (bar.classList.contains("kick-pad")) { this.kickAudio.currentTime = 0; this.kickAudio.play(); } } }); this.index++; } start() { const interval = (60 / this.bpm) * 1000; setInterval(() => { this.repeat(); }, interval); } } const drumKit = new DrumKit(); drumKit.pads.forEach((pad) => { pad.addEventListener("click", drumKit.activePad); pad.addEventListener("animationend", function () { // this.style.animation = ''; }); }); drumKit.playBtn.addEventListener("click", function () { drumKit.start(); });

this.kickAudio.play(); no esta jugando no se porque?? Por favor ayuda

Estoy tratando de reproducir el audio en bucle sobre el div, pero de alguna manera el archivo de audio no se reproduce

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda