Author Topic: Set Default Audio Output Device in Win7  (Read 8218 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Set Default Audio Output Device in Win7
« on: December 01, 2012, 01:09:02 PM »
Microsoft made it difficult to change the default audio output device in Windows7 but here's a plugin that will allow you to do just that.  Unlike other solutions this plugin:

- Lets you set the output device by name (or a substring of the device name) or by ID number.
- Does not open any windows, or require keyboard emulation etc. so it works even when running xbmc in fullscreen.
- Can list currently available audio devices

It is fast and so far seems to work great.

Put the audioendpoint folder from the attached rar into yout VC\plugins folder Enable AudioEndpoint plugin in options.

Import the attached group to get an idea of how to use it, and assign your own ID names and phrases.
« Last Edit: February 23, 2015, 11:53:09 AM by nime5ter »

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #1 on: December 02, 2012, 05:13:12 AM »
Thanks, Very useful indeed.
Neural Net Based Artificial Intelligence.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #2 on: April 30, 2013, 11:48:35 PM »
Need some help :)

I've added the Audioendpoint plugin as I'd like to be able to switch between :

1. audio to the home theatre via optical out from the computer (this is for use with XBMC in our home theatre); and
2. audio to the ceiling speakers throughout the house via the analog out from the computer (this is for use with the WeatherUnderground plugin - so I can ask the computer what the weather will be like when I wake up in the morning and have it play throughout the house's in-ceiling speakers).

I've imported the standard group as per your earlier post. I've attached a self-explanatory pdf that shows the osd when I press 'save and execute'. In the pdf the two sources that I want to use are :

1. Realtek Digital Output (Optical) (Realtek High Definition Audio); and
2. Speakers (Realtek High Definition Audio)

What I'd like to set up is being able to say :

1. "set audio to digital" and have it switch to number 1 above; and
2. "set audio to analog" and have it switch to number 2 above

Is anyone able to give me some help please (or point me in the right direction)?

Thanks in advance!than

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #3 on: May 01, 2013, 08:13:37 AM »
Instead of changing your default audio device, since you are only using this (at the moment) to direct your weather reports to different speakers, you can set the TTS output.

http://voxcommando.com/mediawiki/index.php?title=Actions#SetOutput

Just create one command with the phrase "set audio to digital" and for this command use the action above.  The parameter is just the name of the audio output you want to switch to.  You don't have to enter the whole name, so just "optical" or "hdmi" will work if that is part of (and unique to) the name of the device.

If you don't know how to create your own commands please see here: http://voxcommando.com/forum/index.php?topic=1004.0

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #4 on: May 01, 2013, 09:07:23 AM »
.... I've attached a self-explanatory pdf that shows the osd when I press 'save and execute'. In the pdf the two sources that I want to use are :...

I think you forgot the attachment.  Also, since you are just uploading images, I would appreciate it if you could upload an image file (i.e. jpg or png or gif) instead of a pdf.  Thanks.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #5 on: May 02, 2013, 11:06:33 AM »
Thanks! Setting the audio to the ceiling speakers for that command was a much better solution and worked nicely. I think that what I'll do is set up a command that will set the output to the ceiling speakers if I say 'ceiling speakers'. Most of the time I'd want the output to be in the theatre room. Occasionally I want it to go to the ceiling speakers. Is there a way to set up a global command that if I say 'ceiling speakers' 'play artist Rolling Stones ' (eg.) that it will play the audio through the ceiling speakers (the identifying word is 'speakers'). Can you give me a sense of how to do that?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #6 on: May 02, 2013, 01:18:26 PM »
Thanks! Setting the audio to the ceiling speakers for that command was a much better solution and worked nicely.

Much better than what?  Are you saying the opposite of what you mean?  Do you actually mean "Setting the TTS output to the ceiling speakers for that command was a much better solution..."?

Quote
Is there a way to set up a global command that if I say 'ceiling speakers' 'play artist Rolling Stones ' (eg.) that it will play the audio through the ceiling speakers (the identifying word is 'speakers'). Can you give me a sense of how to do that?
I'm not sure if you are talking about one command or two commands, and I'm not sure what you mean by a "global" command, in this context.

It is better to implement this as two commands.

command A - "Set audio ceiling speakers"
command B - "Play artist xyx"

Although you could do it in one command, there a number of reasons not to.  Using two commands is more efficient, and more flexible.  What if you want to listen to a playlist, or an album, or genre?  What if it is already playing on the ceiling speakers?  Do you really want to have to tell it to play through the speakers that it is already using?  What if the music you want is already playing, but you just want to switch the speakers to another room because you are moving to that room?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #7 on: May 02, 2013, 01:38:59 PM »
If you want the single command that sets your audio output, here's how you do it.  You will most likely need to use payloadXML files, or you need to edit your windows audio devices to use friendlier names, in which case you can use a payloadList.

This example uses payloadXML.

Here is what my audio devices look like:[attachment=2]

and here's the command:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="360" name="Set Audio Output Device by Name" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>AudioEndpoint.SetByName</cmdType>
    <cmdString>{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Set, Set default</phrase>
  <phrase>Audio,Sound</phrase>
  <phrase>Device,Output</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">payloads\audioEPs.xml</payloadFromXML>
</command>

You need to place the attached payloadXML file (audioEPs.xml) in your payloads folder, then edit the phrases and values.  Use whatever you want for the phrases and make sure the values match the actual names of your audio devices like mine do as shown in the image above.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #8 on: May 02, 2013, 09:42:28 PM »
Thanks for all of your help. I've attached the png that shows the names of the audio devices (that I'd meant to attach to the earlier post).

What I had tried to say was that your suggestion of using the TTS audio output to a specific audio was a better solution than the one I had thought would work (saying a phrase to put the audio to the ceiling speakers and then saying another phrase to reset it back to the theatre room speakers).

Basically I'd like to use XBMC and the optical audio out for movies in the home theatre, but use XBMC (or Itunes) and the ceiling speakers out throughout the house for music. The reason I need to switch audio outs is because the optical out goes to an Onkyo amplifier that processes the sound for the home theatre whereas the music/weather goes to a different amplifier that pushes out the audio to the ceiling speakers in the rest of the house.

What I've set up for the weather is that I have three different weather phrases : 'weather today', 'weather tomorrow' and 'weather forecast' (which is for next five days). I've got a TTS.SetOutput command in each of those situations that sets the audio to 'speakers'. That tells VoxCommando to put the weather audio output to the ceiling speakers.

Should I do the same for each of the XBMC music-related commands or is the better/more elegant way of doing this?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #9 on: May 02, 2013, 10:13:20 PM »
At this point, I think it's down to whatever makes the most sense to you.  You can always try something different later.

I have a "watch TV" command that does a few things with my amp, lighting, and launches XBMC.  I have a "listen to music" command that does some other things with my amp, and launches media monkey.  You could do something similar if that works for you, and in those commands you could set the default audio appropriately.

 I'm not sure about iTunes but media monkey lets you opt to use either the default audio, or a specific audio output.  XBMC Eden lets you use the default audio, but XBMC frodo does not, so there is no easy way to switch audio output with frodo.  So if you use MediaMonkey you can have it always use the analog outputs.  MediaMonkey is a great choice for music I think, but there is a bit of a learning curve vs. ITunes, and no 10 foot interface as with XBMC.  I find with music, I don't need this, and prefer voice commands anyway, most of the time.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #10 on: May 04, 2013, 04:20:11 PM »
Having given some more thought to my particular set up, I think that what would work best is if I am able to say "set (or 'change') audio to speakers" to change the audio output to 'Speakers (Realtek High Definition Audio) and say "set (or 'change) audio to digital" to change the audio output to 'Realtek Digital Output (Optical) (Realtek High Definition Audio).

This will allow me to instruct the computer which audio output to choose ('digital' is the home theatre and 'speakers' is the rest of the house) and then start choosing music. If I move from the Home Theatre to the rest of the house (or vice versa) I can just say one of those two phrases (depending on where I am) and the music will follow me.

I have the audioendpoint xml loaded that you sent to me previously. I've attached screenshots that hopefully are self-explanatory. I'm just not sure how to do the above...

Can you please [attachment=2]help me get started? Thanks!
« Last Edit: May 04, 2013, 05:13:49 PM by Snodric »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #11 on: May 04, 2013, 04:48:26 PM »
Ok.  I am sure you can figure this out on your own.  It works exactly the same as TTS.setoutput but instead you use the action

AudioEndpoint.SetByName

The parameter is the name of the audio device or a part of the name of the device.  Just create two commands using whatever phrase you want.  Each command will use this single action. Good luck, and let us know if you are still stuck!

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #12 on: May 04, 2013, 05:30:49 PM »
I'm sure this is simple and I'm missing something obvious... but, I can't seem to get it. I've attached another screen shot - seems to me that I shouldn't have just 'speakers' as the audio endpoint? I've attached a couple of other screenshots that might help?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #13 on: May 04, 2013, 05:56:26 PM »
Just speakers is OK because it is unique to that output.  If you used just 'realtek' that would be a problem.

There is nothing wrong with your action.  If you click the save and execute button it should work.

You don't need to use payloads in your command tree for this command, just a simple phrase.

Then create a second command, which also has a simple phrase, and this time use optical as the parameter.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Set Default Audio Output Device in Win7
« Reply #14 on: May 04, 2013, 10:20:52 PM »
Thanks! I think I finally got it - what was throwing me off was the additional commands that come below the 'set audio by name' command. They were part of the group that you posted and I didn't realize that they were different ways of sending what you want Voxcommando to do. I'm not sure how to use them yet - need to watch the various videos again. However, you'll see that I followed your advice and set up the two commands (one to set the audio to the analog speakers (for the in-ceiling speakers throughout the house) and one to set the audio to the digital speakers (for the home theatre) and it works well.

After all that, however, when I try to play music from XBMC out through the analog port from the computer, I don't get sound. I think that you'd mentioned this earlier that XBMC will only push out audio digitally? I'm going to workaround that by ordering a piece of hardware that converts a digital audio signal to analog (AC3 DTS DD 5.1 Audio Gear decoder aka HD Audio Rush from alliexpress.com).

Hopefully this of some use to others :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Set Default Audio Output Device in Win7
« Reply #15 on: May 05, 2013, 08:36:18 AM »
XBMC can play through analog sound cards no problem.  You just need to set it up correctly.

What I believe I said was that XBMC can't play through the "default" device, you need to tell it exactly which device to play through in XBMC audio settings, and so changing the default device will have no effect on where XBMC audio goes, but this applies only to Frodo, not Eden.  Eden allows you to use the default device.

You certainly don't need to buy any new hardware to fix this.