Re: The ever-fickle SET BELL command
From: Tim Witort (trw7at_at_ixdot.netcomdotcom)
Date: 06/17/04
- Next message: Tim Witort: "Re: The ever-fickle SET BELL command"
- Previous message: Paul Pedersen: "Re: VFP8 Hidden method in subclass"
- In reply to: Mark McCasland: "Re: The ever-fickle SET BELL command"
- Next in thread: Dan Freeman: "Re: The ever-fickle SET BELL command"
- Reply: Dan Freeman: "Re: The ever-fickle SET BELL command"
- Reply: Tim Witort: "Re: The ever-fickle SET BELL command"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Jun 2004 15:49:45 GMT
I'm using the full path to a file on disk - it will not
play from the EXE. The poor sound support in VFP has
always been a glaring shortcoming. When correctly used,
sound can be a critical part of the interface.
-- TRW
Mark McCasland seemed to utter in
news:#qJbSWAVEHA.2520@TK2MSFTNGP12.phx.gbl:
> I have this working, but I do know the file must reside on the disk and
> not compiled into the APP/EXE. Just make sure when you SET BELL TO you
> have the full path included in the file name.
>
> If you want to experiment with API, try the following:
>
> PROCEDURE SoundOff
> LPARAMETERS tnFrequency, tnDuration, tnTimes
> IF VARTYPE(tnTimes) <> "N"
> tnTimes = 1
> ENDIF
> IF VARTYPE(tnFrequency) <> [N]
> tnFrequency = VAL(TRANSFORM(tnFrequency))
> ENDIF
> IF VARTYPE(tnDuration) <> [N]
> tnDuration = VAL(TRANSFORM(tnDuration))
> ENDIF
> tnDuration = MIN(tnDuration, 2000)
> IF tnDuration = 0
> tnDuration = 500
> ENDIF
> IF NOT BETWEEN(tnFrequency, 40, 8000)
> tnFrequency = 800
> ENDIF
> IF NOT BETWEEN(tnTimes, 1, 5)
> tnTimes = 1
> ENDIF
> LOCAL lnI
> DECLARE Beep IN WIN32API INTEGER nFrequency, INTEGER nDuration
> FOR lnI = 1 TO tnTimes
> Beep(tnFrequency,tnDuration)
> ENDFOR
> CLEAR DLLS && optional. comment if you don't want this.
> ENDPROC
>
>
> "Tim Witort" <trw7at@ixdot.netcomdotcom> wrote in message
> news:Xns950AABB77A953timwitortwrotethis@207.217.125.203...
>> VFP8 SP1, WinXP Pro SP1
>>
>> I've got a TOP LEVEL FORM application that has the following
>> code in a button click method:
>>
>> SET BELL TO "C:\some_folder\some_sound.wav"
>> ?? CHR(7)
>>
>> This works like a charm while testing the form in the VFP IDE.
>> When I build an EXE and run the EXE on the same machine, there
>> is no sound. It makes no difference if the WAV file is included
>> in the app.
>>
>> Shall I just give up on using sounds or is there a reliable
>> way to get this to work. The Windows API?
>>
>> -- TRW
>> _______________________________________
>> My e-mail: t r w 7
>> @ i x . n e t c o m . c o m
>> _______________________________________
>
>
--
_______________________________________
My e-mail: t r w 7
@ i x . n e t c o m . c o m
_______________________________________
- Next message: Tim Witort: "Re: The ever-fickle SET BELL command"
- Previous message: Paul Pedersen: "Re: VFP8 Hidden method in subclass"
- In reply to: Mark McCasland: "Re: The ever-fickle SET BELL command"
- Next in thread: Dan Freeman: "Re: The ever-fickle SET BELL command"
- Reply: Dan Freeman: "Re: The ever-fickle SET BELL command"
- Reply: Tim Witort: "Re: The ever-fickle SET BELL command"
- Messages sorted by: [ date ] [ thread ]