Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
¿Es posible especificar un rango para el volumen de AudioWorkletProcessor?

Seguí la documentación del W3C para implementar un "vumeter" (código ) utilizando la Web Audio API de JavaScript, específicamente las interfaces AudioWorkletProcessor y AudioWorkletNode . Me gustaría saber por qué el nivel RMS se compara con el volumen anterior multiplicado por un "factor de suavizado" (lo siento, recién comencé a aprender este tema, así que todo es nuevo para mí):

 // Calculate the RMS level and update the volume. rms = Math.sqrt(sum / samples.length); this._volume = Math.max(rms, this._volume * SMOOTHING_FACTOR);

Además, ¿cuál es el rango que puede tomar la variable de volumen? ¿Es posible saberlo para que podamos suponer que el volumen será un valor en un rango de 0...100?

Código del método de proceso:

 process (inputs, outputs, parameters) { const input = inputs[0]; // Note that the input will be down-mixed to mono; however, if no inputs are // connected then zero channels will be passed in. if (input.length > 0) { const samples = input[0]; let sum = 0; let rms = 0; // Calculated the squared-sum. for (let i = 0; i < samples.length; ++i) sum += samples[i] * samples[i]; // Calculate the RMS level and update the volume. rms = Math.sqrt(sum / samples.length); this._volume = Math.max(rms, this._volume * SMOOTHING_FACTOR); // Update and sync the volume property with the main thread. this._nextUpdateFrame -= samples.length; if (this._nextUpdateFrame < 0) { this._nextUpdateFrame += this.intervalInFrames; this.port.postMessage({volume: this._volume}); } } // Keep on processing if the volume is above a threshold, so that // disconnecting inputs does not immediately cause the meter to stop // computing its smoothed value. return this._volume >= MINIMUM_VALUE; }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!