I have webrtc application which running on android phone(for Nurses) and tablet(for patients). Basically i have implement a remote assistant system by which nurses can make webrtc call and hear(only audio stream) that whats going on in patient side. As tablet are mounted on wall and patient bed are normally little bit on distance. I want to increase the mic gain either in webrtc/android side so that i can hear even a low level sound. I try to find a clue on google but unable to find anything interesting. Can someone give me hint how i would increase the microphone sensitivity ?
------------------------ sample code---------------------
function getLocalStream(successCallback) {
if (localStream && successCallback) {
successCallback(localStream);
return;
}
navigator.getUserMedia(streamOptions, function (str) {
var stream= modifyGain(str);
uiHandler("peer.call.localstream", {payload: stream});
localStream = stream;
if (successCallback) {
successCallback(stream);
}
}, function (err) {
uiHandler("status.error", {payload: "Failed to access local camera", error: err});
});
}
function modifyGain (stream){
var audioTrack = stream.getAudioTracks()[0];
var ctx = new AudioContext();
var src = ctx.createMediaStreamSource(stream);
var dst = ctx.createMediaStreamDestination();
var gainNode = ctx.createGain();
gainNode.gain.value = 50;
[src, gainNode, dst].reduce( function(a, b) { return a && a.connect(b) });
stream.removeTrack(audioTrack);
var newAudioTrack = dst.stream.getAudioTracks()[0];
stream.addTrack(newAudioTrack);
return stream;
};
In debug i have found the difference in previous and new audio track: This is original audio track which i get from localstream:
enabled: true
id: "8e4363c2-f1c8-44ec-9bed-f3414f3b943a"
kind: "audio"
label: "Default"
muted: false
onended: null
onmute: null
onunmute: null
readyState: "live"
This is a new audio track which get dst.stream.getAudioTracks()[0];
enabled: true
id: "cc0c4293-a606-407e-9adb-4caddaa32583"
kind: "audio"
label: "MediaStreamAudioDestinationNode"
muted: false
onended: null
onmute: null
onunmute: null
readyState: "live"
Is id and label matter to play stream ?