GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GabeBigBoxVR/UnityDefaultMicrophone: Helps developers for SteamVR select the default microphone

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
UnityMicLister
UnityMicLister
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
UnityMicLister.sln
UnityMicLister.sln
 
 

Repository files navigation

What Is This?

This is a native binary that allows Unity developers to ask Windows what is the currently default microphone. Currently Unity doesn't seem to support this, so I wrote this wrapper that asks Windows directly. This is useful for users who have a computer with more than one microphone and they can set it through the SteamVR audio preferences or Windows Audio Controls. PS: I wrote this specifically for VR, but it works just fine for regular Windows apps too.

How To Get Started

  • Download the latest release and copy the files from x86 and x86_64 into your Assets/Plugins/x86 and Assets/Plugins/x86_x64 folders respectively
  • In Unity, call the function below to get the currently selected microphone using P/Invoke.
    [DllImport("UnityMicLister", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
    private static extern uint GetDefaultMicrophoneName(out IntPtr argument);

    /// <summary>
    /// Gets the friendly name of the microphone that SteamVR has set as the default
    /// </summary>
    /// <returns>null if none found, otherwise it's the name of the default microphone</returns>
    public static string DefaultMicrophoneName()
    {
        IntPtr argument;
        uint result = GetDefaultMicrophoneName(out argument);

        if (result == 0)
        {
            string micName = Marshal.PtrToStringUni(argument);
            return micName;
        }
        else
        {
            Debug.LogError("Failed to query windows for the default microphone");
            return null;
        }
    } 

License

MIT License

About

Helps developers for SteamVR select the default microphone

Resources

Readme
MIT license
Activity

Stars

14 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.