Author Topic: Switching Audio Sources  (Read 6883 times)

0 Members and 3 Guests are viewing this topic.

mclough6

  • $upporter
  • Sr. Member
  • *****
  • Posts: 105
  • Karma: 0
    • View Profile
Switching Audio Sources
« on: March 08, 2011, 01:40:38 PM »
I would like to automate the multi-step process of switching my audio source in windows 7 to drive my outdoor speakers, opening up xbmc, and going to settings and changing the audio souce there.  And then a separate command to switch it back.  Perhaps using the focus command and events would accomplish this?  Alternatively if the first is not possible, could I break it into three steps, changing the audio source from win7, opening xbmc, and executing an event within xbmc to switch audio? 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Switching Audio Sources
« Reply #1 on: March 08, 2011, 03:13:44 PM »
I would like to automate the multi-step process of switching my audio source in windows 7 to drive my outdoor speakers, opening up xbmc, and going to settings and changing the audio souce there.  And then a separate command to switch it back.  Perhaps using the focus command and events would accomplish this?  Alternatively if the first is not possible, could I break it into three steps, changing the audio source from win7, opening xbmc, and executing an event within xbmc to switch audio?  

If I understand correctly, you want to change with a VC command the audio settings of Windows and XBMC. It might work if you use the mouse controls in VC. To position cursor over the speaker icon in the taskbar, right click, etc., or alternatively use a macro recorder (winautomation.com 30 day trial version) with which you can record the whole process and save as e.g. "Audio.exe". That exe you can run with a launch command with VC.
Give it a whirl, another idea I also do not have.

This was realized and you can find it in this VoxCommandoExtras.zip. The tool called "setDefaultPlaybackDevice.exe", extract it to VC-folder.
A example xml you'll find in the attach.
1. Copy the file "SetAudioOuput.xml" in the VC payload folder
2. Import the "VcGrp_Vox change output.xml" with VC command editor in your "command tree" and edit the payload from this command with a doubleclick on it, and rename the value with deviceoutput names from your system. The phrases in this payload also.
When you have any questions, let me know.


Kalle
« Last Edit: December 25, 2011, 08:41:08 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #2 on: March 08, 2011, 03:26:52 PM »
I think I can whip something up for you.  You will probably need to make some adjustments.  The trickiest part is switching outputs.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #3 on: March 08, 2011, 06:27:57 PM »
It is possible to change the default windows audio output device, and let XBMC use the default.  Is that good enough?

I don't know if it is possible to change the audio device that xbmc uses without actually going through all the menus.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #4 on: March 08, 2011, 06:29:58 PM »
I would like to automate the multi-step process of switching my audio source in windows 7 to drive my outdoor speakers, opening up xbmc, and going to settings and changing the audio souce there.  And then a separate command to switch it back.  Perhaps using the focus command and events would accomplish this?  Alternatively if the first is not possible, could I break it into three steps, changing the audio source from win7, opening xbmc, and executing an event within xbmc to switch audio? 

I actually don't understand your question now that I re-read it.  Why do you want to change the audio device in Windows AND in XBMC?

mclough6

  • $upporter
  • Sr. Member
  • *****
  • Posts: 105
  • Karma: 0
    • View Profile
Re: Switching Audio Sources
« Reply #5 on: March 08, 2011, 09:40:32 PM »
I apologise for not being clear and thanks for your interest in helping me.  I have an old receiver that connects to my computer via RCA cables and outputs to my speakers on the patio and in the kitchen via an A and/or B selection on the receiver.  My TV is directly connected to a soundbar via an optical cable and to my computer via HDMI.  One output from the computer is analog and the other digital.  So to play music outside I have to change the hdmi audio to "speakers" in windows which is analog for the receiver.  Then in order to output music from XBMC I have to change from hdmi output to analog.  Otherwise it does not work.  Maybe that is too much information but I hope that clarifies my situation.  I have considered a macro generator, but I thought I would see if vox could handle it.  I wasn't sure just how far events and focus commands would go.  :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #6 on: March 08, 2011, 10:28:02 PM »
No problem,

If you can, I recommend you set XBMC to use the default audio device.  Then you should be able to switch the default audio device that windows uses and XBMC should use whichever one you select.  I don't know if this will be an issue for you or not, but hopefullly not because I dont' see a way to switch the xbmc device preferences programatically.  You could get VC to open the settings window and then do a series of movements and selections, but it is not a good solution.

If you download the latest patch (0.879 from here: http://voxcommando.com/forum/index.php?topic=414.msg2862#msg2862 ) you'll see that there is a program in there called setDefaultPlaybackDevice.exe

You can call this program using the launch command.  It accepts a single parameter which is the name of the audio output device.  You can call it like this to select the device named:  Speakers

Launch   setDefaultPlaybackDevice.exe&&Speakers

To see the names of the audio devices you can right-click the speaker icon in the notification area and choose "Playback Devices".  There you will see a list, you can also rename devices here if that helps.

It should be easy enough to do the other things you want in a single vox command.  If you are not sure how to do it yourself then try to give me as detailed as possible a list of what you want to happen and I'll try to help.
 :)

by the way, I created the program setDefaultPlaybackDevice.exe using AutoIT and modifying someone else's script that I found online.  If someone wants to have the script used to generate the program just let me know.  AutoIt is a pretty neat program and it's free.

mclough6

  • $upporter
  • Sr. Member
  • *****
  • Posts: 105
  • Karma: 0
    • View Profile
Re: Switching Audio Sources
« Reply #7 on: March 08, 2011, 11:07:13 PM »
Thanks so much.  I may not get around to trying it out until this weekend.  But you have given me several things to think about.  Kalle recommended a macro generator and I have downloaded the trial version.  Perhaps the best solution is a combination of both.  I am pretty sure that I will not be able to use a single default in XBMC.  I already have spent more time than I wish to admit going through various combinations and always have to make two changes, windows and xbmc.  I will try again though, I might have missed something.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #8 on: March 08, 2011, 11:38:59 PM »
something like this might also work for you...  (I have not tested this  ???)
http://forum.xbmc.org/showthread.php?t=86038

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #9 on: March 08, 2011, 11:40:10 PM »
another solution would be to use mediamonkey for your music and set the sound for that to your analog output.  That's what I do.  I mean, I use XBMC for video and MM for music.

mclough6

  • $upporter
  • Sr. Member
  • *****
  • Posts: 105
  • Karma: 0
    • View Profile
Re: Switching Audio Sources
« Reply #10 on: March 09, 2011, 08:50:34 AM »
Thats a great idea.  I have media monkey pretty much set up already.  I kind of gave up on it because I wanted a single media software control and I had some problems making it look like I wanted, but that seems to be the easiest solution.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Switching Audio Sources
« Reply #11 on: March 09, 2011, 09:26:48 AM »
MM works really well with VoxCommando, and it is a much better way to maintain your media library.  Tagging, organizing, download album art etc. is all really well executed.

I believe you can have xbmc use the same folders and files and automatically scan for updates on startup so if you ever want to browse your music from XBMC it should be there and up to date, but when you want to use the music outside you are all set.  For me the main advantage

I think it would be nice if you could also post some feature request to the XBMC community about this though, because I think it is something that is lacking.  You should be able to switch audio profiles with a remote control.

mclough6

  • $upporter
  • Sr. Member
  • *****
  • Posts: 105
  • Karma: 0
    • View Profile
Re: Switching Audio Sources
« Reply #12 on: March 09, 2011, 01:59:18 PM »
Good idea.  I think I will.  By the way, I think your program is great and it is exciting to see all of the improvments you have made.  Hats off to you.