<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>VoiceBot RSS: SCRIPT: Toggle audio speaker - headphone</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=e62efcfc-186d-47f7-bda2-1fc18314f501" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=e62efcfc-186d-47f7-bda2-1fc18314f501</link>
<description>VoiceBot RSS: SCRIPT: Toggle audio speaker - headphone</description>
<lastBuildDate>Sun, 25 Oct 2026 13:40:55 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=e62efcfc-186d-47f7-bda2-1fc18314f501</generator>
<item>
<title>RE: SCRIPT: Toggle audio speaker - headphone</title>
<link>https://www.voicebot.net/Discussions/View/script-toggle-audio-speaker-headphone/?ID=e62efcfc-186d-47f7-bda2-1fc18314f501#2</link>
<pubDate>Thu, 09 Mar 2017 16:24:43 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/script-toggle-audio-speaker-headphone/?ID=e62efcfc-186d-47f7-bda2-1fc18314f501#2</guid>
<category>VoiceBot</category>
<description><![CDATA[Thanks! We've added this script to the repository]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks! We've added this script to the repository <img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" />
</div>
]]></content:encoded>
</item>
<item>
<title>SCRIPT: Toggle audio speaker - headphone</title>
<link>https://www.voicebot.net/Discussions/View/script-toggle-audio-speaker-headphone/?ID=e62efcfc-186d-47f7-bda2-1fc18314f501</link>
<pubDate>Wed, 08 Mar 2017 10:44:24 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/script-toggle-audio-speaker-headphone/?ID=e62efcfc-186d-47f7-bda2-1fc18314f501</guid>
<category>VoiceBot</category>
<description><![CDATA[Code
Copy
Select All
// Change the name of your speaker / headset and separate with comma.&#xA;string audio = &quot;G930,M2550D-4&quot;;&#xA;&#xA;string[] sources = audio.Split(&#x27;,&#x27;);&#xA;string selected = null;&#xA;string target = null;&#xA;string current = BFS.Audio.GetDefaultPlayba...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a1734af918727d88a5c20c59b8c46b" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a1734af918727d88a5c20c59b8c46bJs'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a1734af918727d88a5c20c59b8c46bJs" name="code01a1734af918727d88a5c20c59b8c46bJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">// Change the name of your speaker / headset and separate with comma.&#xA;string audio = &quot;G930,M2550D-4&quot;;&#xA;&#xA;string[] sources = audio.Split(&#x27;,&#x27;);&#xA;string selected = null;&#xA;string target = null;&#xA;string current = BFS.Audio.GetDefaultPlaybackSounds();&#xA;&#xA;for (int j = 0; i &amp;gt; sources.Length; j&#x2B;&#x2B;){&#xA;    if (current.IndexOf(sources[j]) == 0){&#xA;        selected = sources[j];&#xA;        if (sources.Length &amp;gt; j&#x2B;1){&#xA;            target = sources[j&#x2B;1];&#xA;        }else{&#xA;            target = sources[0];&#xA;        }&#xA;        break;&#xA;    }&#xA;}&#xA;&#xA;// Debug&#xA;// BFS.Speech.TextToSpeech(&quot;Changing from &quot; &#x2B; selected &#x2B; &quot; to &quot; &#x2B; target);&#xA;&#xA;foreach (string dev in BFS.Audio.GetPlaybackDevices()){&#xA;    if (dev.IndexOf(target) == 0){&#xA;        BFS.Audio.SetDefaultPlaybackSounds(dev);&#xA;        BFS.Audio.SetDefaultPlaybackCommunications(dev);&#xA;        BFS.Speech.TextToSpeech(&quot;Ready&quot;);&#xA;        return;&#xA;    }&#xA;}&#xA;&#xA;BFS.Speech.TextToSpeech(&quot;Device not found&quot;);</pre><textarea id="code01a1734af918727d88a5c20c59b8c46b" name="code01a1734af918727d88a5c20c59b8c46b" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>