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

178
Visualizações
WebRTC Sending Stereo Audio Stream, Receiving Mono Audio Stream

Hi I have an issue basically I'm sending a stereo audio with WebRTC this way

const audioStream = await navigator.mediaDevices.getUserMedia({
  audio: {
    autoGainControl: false,
    channelCount: 2,
    echoCancellation: false,
    latency: 0,
    noiseSuppression: false,
    sampleRate: 48000,
    sampleSize: 16,
    volume: 1.0,
  },
  video: false,
});

If i check the number of channels I have 2 channels getAudioTracks()[0].getSettings().channelCount

If I check the description I'm sending I have 2 channels

a=rtpmap:111 opus/48000/2

If check the description I'm receiving I have 2 channels.

But The stream I'm receiving has only one channel

connection.ontrack = ({ streams: [stream] }) => {
  audio.srcObject = stream;
  console.log(stream.getAudioTracks()[0].getSettings().channelCount); // =1
};

I don't understand what's going on.

You can try it yourself here

https://codesandbox.io/s/stoic-zhukovsky-kjxrf

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Check out chrome://webrtc-internals/

When I run your code, I get "undefined" for stream.getAudioTracks()[0].getSettings().channelCount when I call it in your GotRemoteStream function.

However, in chrome://webrtc-internals, in RTCInboundRTPAudioStream stats, I see 48 samples per second arriving (that must mean 48kHz stereo for Opus) and also "codec" says "stereo=1" which indicates you are really receiving stereo sound.

about 4 years ago · Juan Pablo Isaza Relatório
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