# Playing sound on SERVER when PHP page is hit



## TommyWillB (Apr 20, 2003)

I wrote a bash shell script that does two things:
	
	



```
echo -e "\a";
Open ./Tink.aiff;
```
The echo line just invokes the terminal alert bell. The Open comman opes a sound file in the default player. (QuickTime or iTunes probably)

These both do exactly what you'd expect when run command line, but neither work when called via one of the system execution commands.

What I'm really trying to do is make my computer beep whenever someone hists one particular page on my Web site.

Anyone know how to make PHP play a sound on the *server*? (...not on the client browser.)


----------



## profx (Apr 21, 2003)

if it dosent have to be immediate you could do a cron job every minute checking if the page had been hit. But there could be a delay of 59 seconds.

I have this set up on my machine so people can write messages on my webpage and they will appear on my screen in a dialog within a minute


----------



## Darkshadow (Apr 21, 2003)

Tommy, I couldn't get it to work, either.  But why not have it write it to a log?  Then you can see whenever someone accesses the page via the log file.

profx, if you're using php for that message thing, you could have it directly write the message to a log too rather than doing a cron job.  Would be easier.


----------



## profx (Apr 21, 2003)

I dont want to have to continously check a log file.  This way it just pops a message up when there is one...   i am using a sh shell script that writes a file containing the message, then cron runs an applescript to check if there is a message, if there is it displays it in a regular applescipt dialog box.

I couldnt figure out any other way of passing a message from user www to me as only one user can have access to the window server.

If you can think if a better way speak up!!


----------



## phatcactus (Apr 21, 2003)

I'd rigged up a nice lil' Konfabulator widget to read my counter file every five minutes or so and if it was different, it would update itself to display the new count and say "counter updated."  It was hot, until i realized that nobody came to my site.


----------



## TommyWillB (May 4, 2003)

> _Originally posted by profx _
> *I dont want to have to continously check a log file.  This way it just pops a message up when there is one...   i am using a sh shell script that writes a file containing the message, then cron runs an applescript to check if there is a message, if there is it displays it in a regular applescipt dialog box.
> 
> I couldnt figure out any other way of passing a message from user www to me as only one user can have access to the window server.
> ...


Can AppleScript "speak" the message?


----------

