-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deviceId
of AudioDeviceManager
is not shareable with other package
#960
Comments
I'm so sorry that I might miss your point, is that mean you need to preview all the video/audio devices at the same time? |
So we need to preview 1 video/audio input device at a time while using it to push to channel. Like, preview a cam/mic before use it to push stream. |
In our example, you can change and preview the device, and then you can control when to push with |
And the main reason for this issue is that we need to show the |
So our problem is that, saying we have 2 cameras: So our feature is that we will show a list of the available cameras inside a So, at the time they preview, we have 2 |
Thanks for your detail, at this time our SDK only supports 2 cameras preview, you can try the |
I would love to know how to do it. |
@nguyenhy The deviceID returned by our SDK is also the deviceID returned by macOS system. Can you please try directly put the device ID returned by our SDK to the deviceID of other SDKs to see if it will work? Maybe they have different numbers but can both be used? Please let us know your test result. |
Hi @qiuyanli1990.
I did try to use agora ID in
I'm really not sure about this. I try to create sample code from // macOS Objective-C
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio];
for (AVCaptureDevice *device in devices) {
NSLog(@"=======");
NSLog(@"localizedName: %@", device.localizedName);
NSLog(@"uniqueID: %@", device.uniqueID);
NSLog(@"modelID: %@", device.modelID);
}
// macOS Swift
let discoverySession = AVCaptureDevice.DiscoverySession(
deviceTypes: [.builtInMicrophone],
mediaType: .audio, position: .unspecified
)
for device in discoverySession.devices {
print("===========")
print("localizedName: ", device.localizedName);
print("uniqueID: ", device.uniqueID);
print("modelID: ", device.modelID);
}
Can you help me point out how to create this |
For your feature, I think you can try using startSecondaryCameraCapture to preview the selected deviceId |
As I mention ealier, the main reason for this issue is that the You can read more about this in this comment
|
I think this can be achieved by using the startSecondaryCameraCapture and preview it without using the other packages, you can check our example for reference. Capture by a deviceId: Line 233 in 216eb04
Then preview it: Line 174 in 216eb04
|
Ok, I will check startSecondaryCameraCapture. But how about final engine = createAgoraRtcEngine();
engine
.initialize(
const RtcEngineContext(
appId: appId,
),
)
.then((value) async {
final videoManager = engine.getVideoDeviceManager();
final audioManager = engine.getAudioDeviceManager();
final videoDevices = await videoManager.enumerateVideoDevices();
final audioDevices = await audioManager.enumerateRecordingDevices();
for (var element in videoDevices) {
print(['videoDevices', element.deviceId, element.deviceName]);
}
/// [Log]
/// flutter: [videoDevices, 0x2100000046d0825, USB Camera VID:1133 PID:2085]
/// flutter: [videoDevices, 0x2200000046d0825, USB Camera VID:1133 PID:2085]
for (var element in audioDevices) {
print(['audioDevices', element.deviceId, element.deviceName]);
}
/// flutter: [audioDevices, 99, default (Unknown USB Audio Device)]
/// flutter: [audioDevices, 95, Unknown USB Audio Device]
}); |
Describe the bug
We're making a desktop app for Windows and macOS users. In this app, there's a feature that allows the user to preview their camera and microphone in case users have more than one video/audio input device.
We decide to use another package to make this, since we can't stream from the one cam/mic and preview the exact cam/mic to allow user previews their cam/mic. Because we can't find a solution to use the same cam/mic one for stream and one for preview, and these 2 have different configs. Even, when we create 2 different
RtcEngine
with the same/differentappId
With record and camera_macos. We were able to make it but there's one problem.
The
deviceId
return from these 2 packages is different than thedeviceId
fromAgora SDK
To Reproduce
Note that I plugin in 2 similar camera
As shown in the above sample code,
record
, andcamera_macos
are able to return the same id for audio input devices, whichs isAppleUSBAudioEngine:Unknown Manufacturer:Unknown USB Audio Device:D5ACA760:3
andAppleUSBAudioEngine:Unknown Manufacturer:Unknown USB Audio Device:33829440:3
.But the id from
enumerateRecordingDevices
return is95
,99
.Expected behavior
method
enumerateRecordingDevices
return value ofdeviceId
as other packageDesktop (please complete the following information):
The text was updated successfully, but these errors were encountered: