Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

307
Visualizações
javascript webrtc in ios: play an <audio> while having access to microphone

I want to play an <audio> while I still have the access to the microphone. However, the iPhone 12 pro automatically decreases the sound level of <audio>.

Actually I don't want to play an <audio> and record microphone at the same time. I want to keep having access to the microphone taken by navigator.mediaDevices.getUserMedia({audio:true}) and play audio with full level of sound. In this way, I don't need to prompt for permission if I need the microphone again.

Also, I like to mention that sound level is ok if the user uses airbods.

What I tried:

When I don't need the microphone I can easily set the enabled property of audio track to false. stream.getTracks()[0].enable = false makes the microphone silent but does not increase the sound level of <audio>. This reaction sounds a bit strange because while the microphone track is silent nothing can be recorded. So decreasing the sound of audio is unnecessary.

I also tried to set the level of audio to 1 but it doesn't have any effect because it is already 1.

My conclusion until now:

It looks like iPhone reduces the sound to stop the possible noise on the microphone. However, It is unnecessary to happen if you have disabled the microphone track.

In Safari if you need the permission again and the time difference between the two permission is more than 90 seconds, user is prompted for permission.

is there any suggestion?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda