1. Download our Official Android App: Forums for Android!

Control Computer's Sound Levels?

Discussion in 'Android Apps & Games' started by nyfael, Apr 28, 2011.

  1. nyfael

    nyfael Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    4
    Joined:
    Apr 28, 2011

    Apr 28, 2011
    4
    1
    6
    COO / Lead Developer
    Los Angeles
    I am trying to create a new Tasker profile that turns off my computer's sound when any of my "Favorites" call me, so that if I leave my phone next to my computer while music is playing, it will shut off and I can hear it ring.

    I've seen many applications control your computer in other aspects, it seems that sound levels has not happened yet -- does anyone know how this would be possible? Or if this has already been done?

    Thanks!

    -Kerry
     

    Advertisement

  2. sitlet

    Rank:
    None
    Points:
    213
    Posts:
    5,867
    Joined:
    Apr 11, 2010

    Apr 11, 2010
    5,867
    633
    213
    I'm not exactly sure how the phone can control what happens on your computer...
     
  3. Tumeg

    Tumeg Android Enthusiast
    Rank:
    None
    Points:
    83
    Posts:
    315
    Joined:
    Sep 9, 2010

    Sep 9, 2010
    315
    94
    83
    I'm sure it's not an impossible thing to do, seeing as how there are apps that can wake-up your computer, and also control iTunes on your computer through your phone.
    I'm sure all it takes is a dev who is willing - and I'm sure the OP's request can become a reality.

    I also must add that I am interested in the same thing as the OP. Something to mute\pause music (really I just need it to pause\mute iTunes, which should make it easier to do? Maybe?) when certain people are calling. Even if it is a stand-alone app (not involved with Tasker), I would be willing to pay for it...
     
  4. nyfael

    nyfael Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    4
    Joined:
    Apr 28, 2011

    Apr 28, 2011
    4
    1
    6
    COO / Lead Developer
    Los Angeles
    @sitlet -- Tumeg is correct.

    I have Gmote, remote for iTunes, there's also an app called "Control Computer" which has things like Shutdown, restart computer, etc. etc. I simply need volume control.

    The other option I'm thinking about is possibly using Tasker + DropBox on your phone, then using:
    DropBox + AutoHotKey (AHK) on your computer:
    Lifehacker, tips and downloads for getting things done

    Thoughts, Tumeg?
     
  5. Tumeg

    Tumeg Android Enthusiast
    Rank:
    None
    Points:
    83
    Posts:
    315
    Joined:
    Sep 9, 2010

    Sep 9, 2010
    315
    94
    83
    Rather than having an app mute my sound, I found one to deliver notifications to my computer when I am receiving a call, or a text.

    Next best thing?

    https://market.android.com/details?id=org.damazio.notifier&feature=search_result

    Now I just need a way to have Tasker activate this app, when I need it to (it only works over WiFi, but I'm not sure what it does when WiFi is off)

    EDIT (3:53pm): This app, combined with "Browsix" = A pretty great fix\solution to your "problem"...
    As for the DropBox + AutoHotKey, that actually sounds like a possibility... However, I'm not a very tech-savvy person, and I won't be able to configure that setup to alter audio\itunes settings, unless I have a step-by-step guide in front of me ;p

    EDIT (3:56pm):http://www.autohotkey.com/forum/viewtopic.php?p=148405
    Wow, I almost have it working! I'll post the instructions, once I am done.

    EDIT (4:12pm): Ugh. I'm running in to a problem - it says to edit the autohotkey script, then save it, and wait the amount of time for it to "kick in" on your computer. The only problem is, I can't open the script on my phone (the file type is not supported). I can't even find a way to edit the script using the DropBox website, which that article says is possible to do - maybe I am missing something?

    Here is the code:
    I just need a way to edit the script file (*.ahk) remotely. So far, I am only able to edit it on my desktop and on the desktop Dropbox app - not on the website app (which, like I said, the Lifehacker article said you can edit it through the website Dropbox interface\app, but I cannot find a way to do so)

    EDIT (4:17pm): Looks like it may not work, after-all
    EDIT (4:48pm): My brother is a programmer (somewhat), and I have asked him to try and work on a solution for us. :)
    He is going to start with trying to find a way to get something in Dropbox to pause\mute your computer (Tasker would trigger the Dropbox file, which would trigger the app), and if that goes well, he will make an app for Android as-well as for your computer that will work together, and hopefully be quicker than Tasker>DropBox>Computer.

    EDIT (5:19pm): Alright, so I got the Tasker task setup - It will upload the script to the folder\directory where AutoHotKey expects the script to be, in order for it to work.
    It would be nice if I could get AutoHotKey to automatically play the script, when it appears (I have posted a question on the AutoHotKey forums, seeing if they can help me figure this out). If this doesn't work, then that Android Notifier app will have to do...

    EDIT (5:53pm): Just realized that Tasker can\will communicate with Android Notifier (it can only enable\disable it)! Which means I am no longer going to try and get this AutoHotKey thing to work. ;p
     
  6. nyfael

    nyfael Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    4
    Joined:
    Apr 28, 2011

    Apr 28, 2011
    4
    1
    6
    COO / Lead Developer
    Los Angeles
    Wow! You went through some extensive efforts.. .and so did I, because I didn't realize you were doing all that. I went down a similar path, and made my work for me.

    I'll explain what I did in just a second -- Android Notifier, the one you linked to: https://market.android.com/details?id=org.damazio.notifier&feature=search_result ?

    Curious how you will get yours to work?

    Okay, now, my solution, it's pretty specific yet very customizable.
    Android: Tasker
    Computer: Digsby, AutoHotKey
    I setup 2 AIM accounts

    Tasker, when receiving a call, sends a text message to AIM which then sends an IM to my computer.

    My computer is running my AHK script which is simply waiting for that message to popup from my username, as soon as it does, it reads the log file that Digsby creates.

    It finds the word that was sent, and then can do any action that AHK can do (which is just about anything).

    AHK mutes and unmutes my computer.

    ------

    I would love to see your final solution -- the main thing that would make this better for me is if there was a better way to directly communicate with my computer, rather than sending a text message, which is interpreted as an IM, and then I have to read the log file that is created.

    I can give the code if anyone wants it. I'd like to see it grow and see what options can come about. I've named it Project Jeeves (kind of playing off Jeeves and Project Jarvis)
     
  7. Tumeg

    Tumeg Android Enthusiast
    Rank:
    None
    Points:
    83
    Posts:
    315
    Joined:
    Sep 9, 2010

    Sep 9, 2010
    315
    94
    83
    Wow.
    Very creative route, you went in!
    Can you post the AHK code? I would like to try and find a different way to trigger it, though yours certainly isn't a bad one :eek:

    And yes, I have told my brother about Android Notifier, and he is now going to try and make a simple app for my computer that will mute the volume, once Android Notifier (and Growl) send the notification to my computer. This should be a simpler task for him, assuming it is as easy as it sounds...
     
  8. nyfael

    nyfael Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    4
    Joined:
    Apr 28, 2011

    Apr 28, 2011
    4
    1
    6
    COO / Lead Developer
    Los Angeles
    That would be great!

    This isn't complete, but its working under my setup. I removed the full file path to my folders simply because I don't want that data posted online -- but I left the end on.

    Code (Text):
    1.  
    2. ;
    3. ; AutoHotkey Version: 1.x
    4. ; Language:       English
    5. ; Platform:       Win9x/NT
    6. ; Author:         Kerry Jones <Kerry.Jones@earthlink.net>
    7. ;
    8. ; Script Function:
    9. ;    Acts as a controller based on instant messages
    10. ;
    11.  
    12. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    13. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    14. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    15. fileLocation = C:\[...]\%A_YYYY%-%A_MM%-%A_DD%.html
    16.  
    17. ; Get the time of the last update
    18. FileGetTime, fileDateTime, %fileLocation%
    19.  
    20. ; This program will stay active
    21. Loop
    22. {
    23.     ; Digsby will popup a ProjectJeeves window
    24.     WinWait, ProjectJeeves
    25.     {
    26.         ; Activate that window, and close it
    27.         WinActivate, ProjectJeeves
    28.         Send ^w
    29.        
    30.         ; Loop until the log of the command has been done
    31.         Loop
    32.         {
    33.             ; Get the time of the file
    34.             FileGetTime, changeFileTime, %fileLocation%
    35.            
    36.             ; If it has changed, then go on
    37.             if changeFileTime > %fileDateTime%
    38.             {
    39.                 ; Read the updated file
    40.                 FileRead, xml, C:\[...]\%A_YYYY%-%A_MM%-%A_DD%.html
    41.                
    42.                 ; Get the command
    43.                 RegExMatch( xml, ">([^<]*)<.span><.div>\s$", command )
    44.                 StringReplace, command, command, </span></div>`n
    45.                 StringReplace, command, command, >    
    46.                
    47.                 ; Execute command
    48.                 If command = mute
    49.                 {
    50.                     ; Mute the computer
    51.                     SoundSet, 0
    52.                     Sleep, 1000
    53.                 }
    54.                 Else If command = unmute
    55.                 {
    56.                     ; Unmute the computer
    57.                     SoundSet, 100
    58.                     Sleep, 1000
    59.                 }
    60.                 Else
    61.                 {
    62.                     ; If something was sent that we don't understand
    63.                     MsgBox Jeeves does not understand command: %command%
    64.                 }
    65.                
    66.                 ; Update the standard time
    67.                 fileDateTime := changeFileTime
    68.                
    69.                 ;; Break out of this loop
    70.                 break
    71.             }
    72.        
    73.             ; It will be updated very fast, check every 1/10 of a seconds
    74.             Sleep, 100
    75.         }
    76.     }
    77. }
    78.  
     
    Tumeg likes this.
  9. Brucew0617

    Rank:
    None
    Points:
    56
    Posts:
    269
    Joined:
    Jan 27, 2011

    Jan 27, 2011
    269
    7
    56
    Earth
    That's really a high technology
     
  10. sonofaresiii

    sonofaresiii Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    500
    Joined:
    Apr 9, 2011

    Apr 9, 2011
    500
    49
    68
    NYC
    see, this is why I love Android. Want your iphone to do something it can't? Too bad! Want your Android to do something it can't? Get creative.
     

Share This Page

Loading...