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

135
Views
AudioConstraints don't work with navigator.mediaDevices.getUserMedia

No matter what I set for the audio constraints, it doesn't seem to affect the audio stream's settings. I have tried different microphones and browsers. I'm trying to get the highest quality stream. I would like a 192k bitrate but I'm not quite sure how sample rate and sample size translate to bitrate.

var textarea = document.createElement('pre');
document.body.insertBefore(textarea,document.body.firstChild)

var constraints =  {
  audio: { 
            sampleSize: 24 //no number works
            sampleRate: 41000 //nothing works unless I use a bad number like 8, then it drops to 24000
         }
}
navigator.mediaDevices.getUserMedia(constraints).then(function success(stream) {
    stream.getTracks().forEach(function(track) {
    textarea.innerHTML = textarea.innerHTML+track.kind+":"+JSON.stringify(track.getSettings(),null, 2);
    })
}).catch(function(err) {
   textarea.innerHTML = err.message;
});

codepen example: https://codepen.io/trackedsupport/pen/BamNvXZ

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!