Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Change Audio Devices in Runtime

Discussion in 'Audio & Video' started by jdanielzik, Sep 19, 2023.

  1. jdanielzik

    jdanielzik

    Joined:
    Mar 1, 2023
    Posts:
    1
    Hey everyone,

    I'm trying to have a simple dropdown for the audio devices, so the user can select their input and output device.
    I was a bit disappointed to see, that this is not natively supported (unless i completely missed something).

    I was wondering what's the best way to go about it, without completely re-inventing the wheel.
    Our project is based on Unity's AudioSystem. We're pretty happy with everything and would love to keep everything as it is, just simply have the option the select the devices.

    Other projects seem to use plugins like FMOD, but using a 140 MB plugin and learning/implementing a new system just to be able to have a functioning dropdown of devices would be the last step we're willing to take. I'm sure all these plugins are great and have their use, but this is selection is all we need.

    Our Application has to function on every common platform.

    Has anyone ever solved this issue or can recommend a more lightweight solution?


    Thanks in advance!
     
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    290
    Hi,

    You're right, Unity does not currently support scanning and selecting audio devices, it's only always sending sound the the system default device.

    The obvious hack would be to tap in the system API (which would then be platform specific) and change the default device. If you're only targeting Windows and/or Mac, I think that's a reasonable amount of work, but still... it sucks...

    I cannot confirm nor deny that this is something we're currently looking at.