Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
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
VoiceBot
WallpaperFusion
Home
▼
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
▼
Features
Features
Incredible Desktop Wallpaper
Monitor Configuration
Monitor Splitting
Powerful Functions
Triggers
Multi-Monitor Taskbars
Useful Windows 10 Tweaks
Useful Windows 8 Tweaks
Windows Lock Screen
Multi-Monitor Screen Savers
Monitor Fading
Window Snapping
Window Management
Mouse Management
Alt+Tab Handler
Window Position Profiles
Desktop Icon Profiles
Remote Control
Available in dozens of Languages
Easy Administration
Free vs Pro
Purchase
Screenshots
Languages
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Scripted Functions (Macros)
Display
Fusion
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 Devices by Wildcard
Return to DisplayFusion Scripted Functions (Macros)
Description
Enter the partial device names on line 17 (in the audioDevices string array). When you run this function, it will switch between each device that matches the text in the array.
Language
C# (.Net)
Minimum Version
8.1.2+
Created By
Thomas Malloch (BFS)
Contributors
-
Date Created
Feb 28, 2017
Date Last Modified
Feb 28, 2017
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
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 audioDeviceIndex = "Script_SelectSpecificAudioDevice_Index"; //read the setting in and try to convert it to an integer int index; if(!Int32.TryParse(BFS.ScriptSettings.ReadValue(audioDeviceIndex), out index)) index = 0; //NOTE: add a list of the audio devices you want in this array string[] audioDevices = {"Speakers", "Headset"}; //increment the index and use the mod operator //to keep it in the array bounds index = ++index % audioDevices.Length; //search for the current index in the list of audio devices string[] allDevices = BFS.Audio.GetPlaybackDevices(); foreach (string device in allDevices) { //if we didnt find it, continue to the next one if (device.IndexOf(audioDevices[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.SetDefaultPlaybackSounds(device); BFS.Audio.SetDefaultPlaybackCommunications(device); break; } //save the currently selected index BFS.ScriptSettings.WriteValue(audioDeviceIndex, "" + index); } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch