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

114
Views
audio.play() plays like a telephone call voice interestingly

Here is my simple audio play function:

let audioPlayResolve;

async function audioPlay(source) {
    return new Promise(resolve => { 
        audioPlayResolve = resolve;
        if(source === undefined) { resolve(); return; }
        const audio = new Audio(source);
        audio.crossOrigin = 'anonymous';
        audio.volume = 0.9;
        Playing.audios.push(audio);
        audio.play();
        audio.onerror = function() {
            console.log("Error loading: " + this.src);
            resolve(); 
        }
        audio.addEventListener("ended", function() {  
            audio.currentTime = 0;          
            resolve();          
        }); 
    });
}

This is working fine on chrome windows.

The issue is when I play audio in Android Chrome the voice gets somehow distorted like it's a telephone call voice.

The interesting thing is when I decided to change the volume of my phone I noticed the audio volume is not controlled by media volume but call volume.

So if I turn down the media volume of my phone to 0 the audio I played via the above function still has volume and I can hear it!

What should I do to solve these two issues?

  • The quality of audio playing
  • The volume should be controlled like normal audio via media volume not call volume
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!