Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Is there a cross-platform way to detect if the current mic is usb or built-in?

Discussion in 'Audio & Video' started by dynamicbutter, May 1, 2024.

  1. dynamicbutter

    dynamicbutter

    Joined:
    Jun 11, 2021
    Posts:
    81
    I want to detect when a USB mic is connected vs the built-in mic. Currently I do this by knowing the mic's deviceName for each platform. Do you know of a cross-platform way to do this without looking at deviceNames?
     
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    454
    Currently, there is no interface in Unity allowing to differentiate capture device types, and I am not aware of a strong cross-platform library providing such information. Even with native APIs, this information is not always obvious to get or even available... :\
    I'd say that the device name is probably the best source of information there.
     
    dynamicbutter likes this.
  3. dynamicbutter

    dynamicbutter

    Joined:
    Jun 11, 2021
    Posts:
    81