Click to See Complete Forum and Search --> : Play .wav on server side???


Jaime
09-25-2004, 09:33 PM
I do not have much experience with web design (although I do have just a little) and I am stumped about how to accomplish something. This is sort of a "stupid" request, but please try to refrain from laughing.

I use a webcam sureillance program to monitor my dog while I am at work (I keep him locked in my bedroom). Lately he has been tearing a few things up and I am just forced to sit there and watch him do it through my computer at work. The software is Digi-watcher and it uses a web interface for me to connect to. I AM able to edit this web page.

My question is whether or not there is a way to create a link on this web page (that is located on my home computer) that will play a pre-recorded sound on my computer at home "yelling" at my dog to stop.

Any help with this will be MUCH appreciated.

pawky
09-25-2004, 10:22 PM
lol

i wouldnt know too much about how to accomplish this. Though if you were able to upload at your work then i suppose (i am just shooting in the dark and have no clue how efficient this would be or anything or if it will even work :P)

What if you had an auto refresher on your site (ever 5 seconds or so) and then at your work when you see him doing it you have some code that u enter into the site to play the music (just a simple bgmusic w/ loop 1 however u do it) and upload it. Because u have the auto refresh on it should refresh the information and the 'music' should play. Once it is done u upload the original page w/ o the 'music' so it doesnt continually yell at him :P Now if i even made sense then that might work. And if i did make sense, there is a good possibility it wont :P so any help from others would be good too :P gl (also, how old is your dog? is he still a pup? if so then obidience school would be the best solution. If he is not a young pup and is old, then u know for your next dog ;P)

Jaime
09-25-2004, 10:32 PM
If I understood you correctly, I don't think that simply uploading a new webpage would accomplish this. Even after the page was uploaded to my desktop at home (the "server"), I would have to open the webpage on my home computer, and this could be difficult considering I am at work.

He is a MinPin. I still consider him a pup, but he is just over a year old. A while back we tried the whole obiedience school, but unfortunately he unofficially got "expelled", if you get my drift. He is a handful but does listen if you tell him something. The problem is that I'm not there to tell him. lol

IncaWarrior
09-25-2004, 10:33 PM
hey that's clever

I don't think any server side languages were made to run programs like that actually on the server since there isn't much of a need

pawky
09-26-2004, 12:00 AM
Originally posted by Jaime
If I understood you correctly, I don't think that simply uploading a new webpage would accomplish this. Even after the page was uploaded to my desktop at home (the "server"), I would have to open the webpage on my home computer, and this could be difficult considering I am at work.

no, u have the auto refresh on the page so that way once u have the new data loaded on it auto refreshes itself w/ the new info u uploaded. You just have the blank page or whatever always up on your computer. make more sense? or no? ;P

Jaime
09-26-2004, 01:24 AM
ahhhh. I see what youre saying now. That's acutally a great idea but I don't think I will have a way to upload my new pages. The home computer is not acutally a "web server". When the surveillance software is running, it accepts web requests to view a auto-refreshing jpg. So I have no ftp set up or anything.

IncaWarrior
09-26-2004, 09:06 AM
well you could make a page that would change the one that's reloading to yell and not yell.

BTW I don't think that the computer yelling at your dog will make it stop

ray326
09-26-2004, 01:25 PM
You can do this pretty easily with a CGI process. I can do whatever magic is needed to play a wave file or shock the dog or whatever. If you can play a sound from the command line then you can do the same through CGI.

Jaime
09-26-2004, 02:19 PM
Can you clerify for me how I can use CGI to do this? Also, I am not sure whether or not the webcam software's web server supports CGI. How can I determine this? And finally, how would I go about creating this CGI program (ie: do i have to download the cgi code or what). Sorry for my ignorance, I am inexperienced to this. Thank you for your help.

ray326
09-26-2004, 07:13 PM
CGI (Common Gateway Interface) is a definition of how a web server can spawn an application on the server to handle a particular request. You'll have to first check the docs for or contact the supplier of your web cam software to see if it has this capability.

You probably wouldn't have to create a program at all; you should be able to use the CGI interface to run an existing program.

Jaime
09-26-2004, 07:47 PM
Cool. Thanks, i will search through the help files. I doubt it will say anything though so i will probably have to email their support. thank you for your help

Jaime
09-26-2004, 09:14 PM
OK. I found a different webcam software that uses Java. I am assuming that you can run a CGI script with Java, correct??? If so, would you be able to post an example script that executes a .wav file?

ray326
09-26-2004, 09:55 PM
Sorry but that doesn't mean it can do CGI or any other kind of custom server-side process. If it can do it, it will either say it does it in such-and-such standard way or it will have a BIG chapter on how to use its proprietary API.

PeOfEo
09-26-2004, 10:45 PM
Here is another way to do it. Write a small application or have one written for you in something simple like vb. Then have a page made with asp, php, or something execute it on page load. The exe plays hte sound then closes. Simple. I have run command prompt and batch files from asp, its really easy to do.

PhillMc
09-26-2004, 11:59 PM
That was the route that I was going to suggest. Really, what you are asking is rather simple. This is something that I would do in ASP or ASP.net.

Your idea is rather nifty, I must say, but I don't think your system yelling at your dog will help. lol

pawky
09-27-2004, 12:19 AM
Originally posted by PhillMc
Your idea is rather nifty, I must say, but I don't think your system yelling at your dog will help. lol

that is why he also gets a hologram of himself ;P

PeOfEo
09-27-2004, 09:42 PM
Originally posted by pawky
that is why he also gets a hologram of himself ;P one of those can easily be made with asp.net. Find me another server side language that can do that!

ray326
09-28-2004, 10:47 AM
Guys, I believe his problem is these web cam interfaces have imbedded proprietary web servers.

PeOfEo
09-28-2004, 12:55 PM
Originally posted by ray326
Guys, I believe his problem is these web cam interfaces have imbedded proprietary web servers. But that is what allows him to see his dog. He can run another server side by side on another port with the webcam server to run his scripts.

Jaime
09-28-2004, 05:47 PM
Ok everyone, thanks for the help. I solved my problem. I installed yahoo messenger on my home computer and changed the default sound that plays when you receive an instant message to my own sound file (since i am the only one who knows of the account no one else will set it off). When i instant message myself from work it plays my voice telling him to stop. thanks again.

PhillMc
09-28-2004, 06:04 PM
Nice little work-around. :)

PeOfEo
09-28-2004, 08:16 PM
Originally posted by Jaime
Ok everyone, thanks for the help. I solved my problem. I installed yahoo messenger on my home computer and changed the default sound that plays when you receive an instant message to my own sound file (since i am the only one who knows of the account no one else will set it off). When i instant message myself from work it plays my voice telling him to stop. thanks again. Like securing a car door with duct tape... I like it :D

Jaime
09-28-2004, 08:23 PM
i actually thought of it when i wasnt infront of my computer and someone kept IM'ing me. Each time they did, it kept "notifying" me unless the window was selected. It only took me 5 days to think of it :D

abandcy
09-29-2004, 09:08 PM
Another idea, non computer. Our friend's dogs go berzerk when they hear his voice on the answering machine...what if you put the answering machine in that room so that you could call your own number, and actually talk to your dogs in real time. After the answering machine picks up you could leave your dog a message. You could be watching them on the webcam, and tell them "No! Bad dog", then "Good boy!" when he stops. :)

PeOfEo
09-29-2004, 09:23 PM
Originally posted by abandcy
Another idea, non computer. Our friend's dogs go berzerk when they hear his voice on the answering machine...what if you put the answering machine in that room so that you could call your own number, and actually talk to your dogs in real time. After the answering machine picks up you could leave your dog a message. You could be watching them on the webcam, and tell them "No! Bad dog", then "Good boy!" when he stops. :) nice idea, but then you have the phone ringing and all to deal with. If you executed an exe file on the pc through a server side web page you could control which sound gets played too. But you would have to do some scripting.

PhillMc
09-29-2004, 09:27 PM
That is a good idea. You could set the machine to pick up after 1 ring when you are out, and turn it off when you get in.

Jaime
09-29-2004, 10:41 PM
i thought about the answering machine too!!! :D The reason i abandoned that one is that i didn't want people to think i was crazy if they walked by my desk and heard me yelling into the phone "bad dog....stop!!!) lol I would laugh if i heard it. and besides, i wouldn't have been able to be loud enough to get him to stop doing whatever he was doing.