Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: ph.playsound doesn’t work Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jhoski
Newbie
Newbie


Joined: January 12 2009
Online Status: Offline
Posts: 13
Posted: March 21 2009 at 10:47 | IP Logged Quote jhoski

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 View jhoski's Profile Search for other posts by jhoski
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: March 21 2009 at 11:01 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: March 21 2009 at 23:52 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
jhoski
Newbie
Newbie


Joined: January 12 2009
Online Status: Offline
Posts: 13
Posted: March 22 2009 at 09:45 | IP Logged Quote jhoski

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 View jhoski's Profile Search for other posts by jhoski
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum