Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?
Save up to 50% on our desktop apps during our Year End Sale!Save up to 50% on our desktop apps during our Year End Sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save up to 50% on our desktop apps during our Year End Sale!

Change Audio Device by Wildcard

Description
This script will change to an audio device by wildcard. Some TVs and projectors end up with different numbers at the end of their device name when disconnected/reconnected. In this sample script, the device name is always SAMSUNG-1, SAMSUNG-2, etc.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Jan 29, 2016
Date Last Modified
Jan 29, 2016

Scripted Function (Macro) Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		string[] audioDevices = BFS.Audio.GetPlaybackDevices();
		foreach (string device in audioDevices)
		{
			if (device.Contains("SAMSUNG"))
				BFS.Audio.SetDefaultPlaybackSounds(device);		
		}
	}
}