Normal Topic @PLAY problem (Read 942 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
@PLAY problem
Mar 13th, 2004 at 1:36am
Print Post Print Post  
Is anyone else having a problem with the following function?
Quote:
@PLay("Sound","1800,5000")
I get no sound, I get no delay.

I have used frequencies from 15 - 12000
I have used delays from 50 to 500000
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @PLAY problem
Reply #1 - Mar 13th, 2004 at 2:05am
Print Post Print Post  
We'll check this out and see if we see a problem.

Meanwhile, as a side note, if you are just trying to use @Play to create a delay (like one did in Q&A), are you aware of the Loiter() function?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @PLAY problem
Reply #2 - Mar 13th, 2004 at 2:44am
Print Post Print Post  
AARGH!  Roll Eyes  Too late, I already did it.  Roll Eyes
Missed it completely. Embarrassed  Looked for Wait, Delay, Pause, Linger.   Roll Eyes

This is what was done......trash it now.....
Quote:
/ =================== DELAY ============
SubRoutine srDelay(vDelay)             //Creates a delay of vDelay seconds

/*      Frequency of 20000 was chosen to be at the high end of the scale
     of human frequency which is normally between 15.0 and 20,000.
     Remember that there is a high frequency tone being generated during
     the time of this delay.                 */

     vDelay = vDelay * 1000                       //duration of 1000 = 1 second (rough)
     vTemp = "20000," & @STR(vDelay)      
     @Play("Sound",vTemp)

End subroutine
Only difference is that the input is in User Friendly seconds.  Don't have to remember any conversion numbers.  May do that  by using @Loiter vs. @Play.....

Thanks lots Erika......... You have just eliminated any Loitering on my part.  Just when I deserved a break too!  Thanks again for pointing that out...Dummy Me!   Embarrassed
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @PLAY problem
Reply #3 - Mar 13th, 2004 at 4:34pm
Print Post Print Post  
I've checked into what's up with @Play. @Play was included for Q&A compatibility, but, as noted in the Programming Manual, it may or may not work reliably. The Q&A method used to generate those beeps and clicks is outdated to the point where it simply no longer works on all operating systems and hardware. This is not something we can fix. It will either still work on your machine, or it won't.  Smiley

Sorry you had trouble finding Loiter(). We tried to pick names that were unlikely to collide with things you might want to name your elements,or have already named your Q&A fields. Names like Sleep, Wait, Pause, etc. seemed too common.   Grin
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @PLAY problem
Reply #4 - Mar 13th, 2004 at 8:14pm
Print Post Print Post  
Quote:
We tried to pick names that were unlikely to collide

You did that real good, but still my fault. Embarrassed It was right there in front of me. Embarrassed

Good news is that we now have another Known Problem to be added to the checklist.

Are there any guidelines about  when it will/(not) work? 
Is it all parameters: "BEEP", "SOUND", and "SOUND"
Any specific OS / BIOS?

Is there another function to provide an audible alert to the user?  Here is a function that I just created.
Quote:
// =============== PLAY WAV SOUND ============
SubRoutine srPlaySound(vSound as String)             //Plays a WAV file

/* This uses a utility, wav.exe, freeware available from
http://www.cmdtools.com/files/wav.zip ; /q is quiet mode. /vnnn is volume
Properties of command need to be set to run in minimized mode.
Basic structure example is on the next line:
n = @SHELL("C:\Utils\wav.exe C:\Windows\media\chimes.wav /q /v100")

SubRoutine would be called like srPlaySound(ALARM)
A database of sound files is created, each with a unique User-Friendly name. 
That name (ID) is looked up to retrieve the name and
path of the wav file.  This allows different locations for files.
A. The path XLU could be eliminated and the path can be hardcoded.
B. An XLU could also be done for sound program to allow other file types
such as MIDI.  That returned value would replace "C:\Utils\wav.exe".
C.  The value for volume could also become a variable. */

vSoundFile = @XLU(@FN,vSound,"frmSounds!ID","SoundFile")
vSoundPath = @XLU(@FN,vSound,"frmSounds!ID","SoundFilePath")
n = @SHELL("C:\Utils\wav.exe " & vSoundPath & "\" & vSoundFile & " /q /v100")

End subroutine

It does not play frequency notes, and has no duration period, but it can be used to alert the operator of certain conditions/errors/MSGBOX, etc.  Different conditions could have different sounds. 
This could run once, or be looped to run x number of times. or for x minutes (See Loiter() Grin ), or to run indefinitely.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @PLAY problem
Reply #5 - Mar 13th, 2004 at 9:24pm
Print Post Print Post  
Quote:
Good news is that we now have another Known Problem to be added to the checklist.

Are there any guidelines about  when it will/(not) work? 
Is it all parameters: "BEEP", "SOUND", and "SOUND"
Any specific OS / BIOS? 


We're not putting this on the known bugs list, because it's not a Sesame bug that we can fix. We make the appropriate system call. If the system can respond, it does. If it can't, there's nothing we can do about it. There is already a note in the programming manual to this effect.  @Play is only there at all for backward compatibility. There are so many combinations of OS and hardware that may or may not fail that we can't possibly predict or list them.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @PLAY problem
Reply #6 - Mar 14th, 2004 at 8:20am
Print Post Print Post  
THANK YOU VERY MUCH for the updated list of  Known Problems!  Grin  Grin  Grin

You have probably already saved me many hours today by noting the "CheckBox ImmediateChange Event", the "XUSR Field Name", and the "blank values in number fields" issues.   Grin  Grin  Grin

Thanks again for listening.  These are the things that will help make Lantica a company to recommend.

Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin  Grin


  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged