Author |
|
jhoski Newbie
Joined: January 12 2009
Online Status: Offline Posts: 13
|
Posted: March 21 2009 at 10:47 | IP Logged
|
|
|
I am unable to get the ph.playsound("sound.wav",0) function to do anything.
All I get is a windows beep and pop-up message that disappears too fast to see.
I was finally able to capture the message which says the script you are running is taking longer than expected to run.
I also tried it in a standalone formula and I still get the windows beep, but I don't see the pop-up window.
Is there some configuration needed to get sounds to play?
I have winamp installed and running.
Thanks
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: March 21 2009 at 11:01 | IP Logged
|
|
|
If this is not a typo
jhoski wrote:
ph.playsound("sound.wav",0) |
|
|
then try this: ph_playsound("sound.wav",0)
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: March 21 2009 at 23:52 | IP Logged
|
|
|
jhoski,
Assuming you're using vbscript (otherwise, Pete has the correct format), you may need to remove the parenthesis like this:
ph.playsound "tada.wav",0
I just tested this and verified on my system and successfully played back the sound. I also got the timeout messagebox so just set the timeout value to -1 so I wouldnt get it (the sound still played though).
The ph_playsound and ph.playsound routines don't use Winamp and just use the standard Windows multimedia device. You may want to try Pete's version as a standard PH formula to verify that you do get sound being played. If you don't, I suspect that a default WAV device is not setup (or the volume is too low/muted for the WAV out device).
Dave.
|
Back to Top |
|
|
jhoski Newbie
Joined: January 12 2009
Online Status: Offline Posts: 13
|
Posted: March 22 2009 at 09:45 | IP Logged
|
|
|
Thanks,
I have it working now. My syntax was correct using javascript, it was several other errors on my part.
You seem to get the windows beep I mentioned when it cannot find the file.
I had read in a different post that it would find files by default in the powerhome web directory, however that appears to be untrue.
So I put a full path name in a simple formula and it worked.
So back to javascript and it still did not work. Then I remembered that in javascript the backslash is an escape character in strings. They have to be doubled up to get a single backslash. After I got the file name string right it started working.
Thanks.
|
Back to Top |
|
|