Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
CloudShow Manager
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
TrayStatus
VoiceBot
WallpaperFusion
Display
Fusion
by Binary Fortress Software
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
Features
Free vs Pro
More
Screenshots
Scripted Functions (Macros)
Languages
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Purchase
Login / Register
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Change Between Multiple Audio Recording Devices by Wildcard
Return to DisplayFusion Scripted Functions (Macros)
Description
Based on the scripted macro by Thomas Malloch at https://www.displayfusion.com/ScriptedFunctions/View/?ID=94f60186-217e-4798-9c78-7f168034ea61.
Language
C#.net
Minimum Version
9.7+
Created By
Mr. S
Contributors
Thomas Malloch (BFS)
Date Created
Nov 20, 2020
Date Last Modified
Nov 20, 2020
Scripted Function (Macro) Code
Copy
Select All
//based on the scripted macto by Thomas Malloch at https://www.displayfusion.com/ScriptedFunctions/View/?ID=94f60186-217e-4798-9c78-7f168034ea61 using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { //a string to read and write script settings const string RecordDeviceIndex = "Script_SelectSpecificAudioDevice_Index"; //read the setting in and try to convert it to an integer int index; if(!Int32.TryParse(BFS.ScriptSettings.ReadValue(RecordDeviceIndex), out index)) index = 0; //NOTE: add a list of the audio devices you want in this array string[] RecordDevices = {"LogitechMicrophone", "OculusMicrophone", "Microphone"}; //increment the index and use the mod operator //to keep it in the array bounds index = ++index % RecordDevices.Length; //search for the current index in the list of audio devices string[] allRDevices = BFS.Audio.GetRecordingDevices(); foreach (string device in allRDevices) { //if we didnt find it, continue to the next one if (device.IndexOf(RecordDevices[index], StringComparison.OrdinalIgnoreCase) == -1) continue; //if we got this far, we found it! //set the playback and communications device and exit the loop BFS.Audio.SetDefaultRecordingCommunications(device); BFS.Audio.SetDefaultRecordingSounds(device); break; } //save the currently selected index BFS.ScriptSettings.WriteValue(RecordDeviceIndex, "" + index); } }