AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
11/23/2024 - 03:56 AM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
Send noise to annoy my cats
By: RaleighMu
Rank: Frequent User
Topics: 24
From: USA
Added: 08/16/2010 - 10:02 PM

I use AbelCam, among other things, to make sure my cats are behaving themselves. When I see one of them doing something I don't like, it would be nice to be able click on a button to send a pre-selected sound.

Right now, I'm going to set up Skype with AutoSkype to have a one directional intercom (my office to my home) but it would be a nice feature to be able to have the ability to have links (I'd use buttons) so I could click on "Get off the couch!" or "go use your kitty litter box you little schmuck!" or "good kitty!"

One can only ask.

St. Louis, Missouri, USA
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/17/2010 - 01:50 AM

If you're interested in an immediate solution that requires a little work on your part Smile! then here you go...

Record your messages as mp3 or wav files (I tested with mp3) and put them on the machine that runs AbelCam.

Set up AbelCam "Command" feature to invoke Media Player with specific sound file when a certain URL is called for. Make as many Command entries as you like - one entry with one unique URL per sound file.

The first time you call one of your new URLs Media Player will launch and play the specified file. It will not close when the file is done playing. However, successive calls to ANY of your sound playing URLs will reuse the same player - there will not be a pile of players left on your screen when you get home. Interrupting a sound while it's playing (by requesting the same sound again or requesting another sound) will also reuse/reset the same player. So, this technique is not a resource killer.

Screenshot below is how I set up 2 sounds for testing. Despite appearances, this was tested on XP (I use modified Classic theme). This technique, with obvious changes, should also work with WinAmp or VLC or whatever if you really hate Media Player.

To play Sound 1, link to (or type into browser):
http://yourdomain.com/sound1

Sound 2:
http://yourdomain.com/sound2

and so forth.



EDIT TO ADD:

There's also another way to do this - same but different...

Set up only one command in AbelCam. Using "sound1" in the above screenshot as the example, you'd do everything the same except that the "Parameter" field would be empty.

Assuming that your mp3 files are in c:\temp the URLs become:

http://yourdomain.com/sound1?c:\\temp\\tester1.mp3
http://yourdomain.com/sound1?c:\\temp\\tester2.mp3
http://yourdomain.com/sound1?c:\\temp\\goodkitty.mp3
and so on...

Note the double '\' characters in the paths. A bit dodgy but necessary to get it to work. Using a single '%5c' in place of each '\\' is more correct and also works but made for a really goofy looking example.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/17/2010 - 05:18 AM

Another thing I've run into...

All the stuff above using Media Player fails when running AbelCam as a service. An "invisible" Media Player (I can see it in the task manager, but not a trace of it on the screen) launches but doesn't play. This was halfway expected - launching an interactive app from a service is probably not a real brilliant move.

However... I tried the same thing using my ancient Winamp 2.75 and it works! An invisible Winamp launches and plays the file. There's one instance of Winamp left running invisibly when the sound has finished playing, it's reused for subsequent sounds, so resources aren't being devoured. However, the only way to close it if you needed to is either reboot or kill the process from the task manager.

No idea what will happen if you use a version of Winamp that's not 10 years out of date...

Can you tell I'm having fun with this?? lol
By: RaleighMu
Rank: Frequent User
Topics: 24
From: USA
Added: 08/17/2010 - 05:43 PM

Message has been edited, click here to see original content
Thanks as usual! Good demonstration of the External Commands hook which opens up a lot of possibilities. I prefer the "same but different" version you cite since that only requires a single command, and can also be passed ANY internet addressable sound file that can be played by Windows Media Player. For the record, and others reading this thread, the examples cited mentioning "http://yourdomain.com/ ..." should include the appropriate port number. E.g., I'm using the suggested port 8080 on my cams, so I would have to enter: http://yourdomain.com:8080/sound1?c:\\temp\\tester1.mp3 As usual, thanks again MelvinG. Now it's time to go annoy my cats!
St. Louis, Missouri, USA
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 08/18/2010 - 01:56 AM

Thanks for the idea! Annoying the cats is always a Good Thing Cool!

External Commands is a much overlooked powerful feature that I've found to be very useful for doing "stuff" within the framework of existing capabilities.

Before AbelCam had plugins, and before I went over to using an Apache front end, External Commands handled all my light controls and Nixie Tube posting by running external Perl scripts. External Commands + Perl = some serious power to do stuff. I don't use that method so much anymore because: 1) K8055 and X10 plugins are a cleaner way to do light controls; 2) Apache mod_perl lets me put the slow part of the Nixie posting script into a "cleanup handler" that frees up the user's browser right away and then continues to work on slow stuff (like getting weather data from RSS feeds and the posting it).