I have this function that returns an observable that emits a deviceId and its related MediaStream:
private getStreamToDeviceId(deviceKind: "audioinput"