Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda