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

284
Vistas
La forma más sencilla de enviar parámetros desde el formulario html al script node.js en el mismo servidor

¿Necesito express o hay una forma más sencilla de pasar estos 3 valores a mi script node.js en el mismo servidor? Use ejemplos para explicar, ya que soy completamente nuevo en la programación.

 <head> <script type="text/javascript" src="ttsForm.js"></script> </head> <body> <form name="ttsForm" action="javascript:ttsForm()"> <p>Filename: <input type="text" name="filename" value="">.wav</p> <p> <select name="voice"> <option value="en-US-AmberNeural">Amber</option> <option value="en-US-AriaNeural">Aria</option> </select> </p> <p><textarea type="text" name="script" rows="20" cols="100"></textarea></p> <input type="submit" value="Send" /> </form> </body>

Esto va a Azure para traducir de texto a voz:

 function ttsForm() { const sdk = require("microsoft-cognitiveservices-speech-sdk"); const key = 'somekey'; const region = 'myregion'; // var filename = document.getElementsByName('filename')[0].value; // var voice = document.getElementsByName('voice')[0].value; // var script = document.getElementsByName('script')[0].value; var audioConfig = sdk.AudioConfig.fromAudioFileOutput(filename); const speechConfig = sdk.SpeechConfig.fromSubscription(key, region); // speechConfig.speechSynthesisOutputFormat = SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm; var synthesizer = new sdk.SpeechSynthesizer(speechConfig, audioConfig); synthesizer.speakTextAsync(script, function (result) { if (result.reason === sdk.ResultReason.SynthesizingAudioCompleted) { console.log("synthesis finished."); } else { console.error("Speech synthesis canceled, " + result.errorDetails); } synthesizer.close(); synthesizer = undefined; }, function (err) { console.trace("err - " + err); synthesizer.close(); synthesizer = undefined; }); console.log("Now synthesizing to: " + filename); }; ttsForm();
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