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

237
Vistas
How to use sound-play module in node.js

I tried to install several modules to play audio in node.js. I've tried various modules, but none of them worked.

Among them, I would like to ask you whether the most popular module works.

The link to the module is here. https://npm.io/package/sound-play

Here's the code that failed.

const express = require("express"),nunjucks = require("nunjucks"),fs = require("fs").promises;
const app = express();
const path = require("path");
const sound = require("sound-play");

....


app.get("/play", (req, res) => {
  fs.readdir("./musicBox")
    .then((filelist) => {
      const filePath = path.join(`./musicBox/`, filelist[count]);
      console.log(filePath);
      sound.play(filePath);
    })
    .catch((err) => {
      throw err;
    });
    res.redirect("/");
});

and index.html is

...
<form  action="/play" method="get">
  <input type="submit" value="재생"/>
</form>
...
There's no error message when you click it.

about 4 years ago · Juan Pablo Isaza
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