Closed SPDSirGuiL closed 5 months ago
I'm having problems changing the microphone during the call, using this code:
` const localStream = session.connection.getLocalStreams()[0] const audioTracks = localStream.getAudioTracks()
audioTracks.forEach((track: MediaStreamTrack) => { track.stop() })
const constraints = { audio: { deviceId: { exact: microphoneId } }, }
navigator.mediaDevices .getUserMedia(constraints) .then((newStream) => { session.connection.removeStream(localStream) session.connection.addStream(newStream)
const renegotiationOptions = { useUpdate: true, mediaStream: newStream, mediaConstraints: { audio: constraints }, RTCOfferOptions: { audio: constraints }, } session.renegotiate(renegotiationOptions, () => { console.log('Sessão renegociada com sucesso.') }) }) .catch((error) => { console.error('Erro ao alterar o dispositivo de áudio:', error) })
`
But there is completely no sound from the microphone when using this. How do I change the microphone during the call?
Please don't use GitHub issues to make usage questions, use the JsSIP public mailing list.
I'm having problems changing the microphone during the call, using this code:
` const localStream = session.connection.getLocalStreams()[0] const audioTracks = localStream.getAudioTracks()
audioTracks.forEach((track: MediaStreamTrack) => { track.stop() })
const constraints = { audio: { deviceId: { exact: microphoneId } }, }
navigator.mediaDevices .getUserMedia(constraints) .then((newStream) => { session.connection.removeStream(localStream) session.connection.addStream(newStream)
`
But there is completely no sound from the microphone when using this. How do I change the microphone during the call?