Hi
Can I play a .wav sound on app opening.
I'm using vfp8.
What and where do I put the code?

Thanks
Sherry

Re: sound by KevClark64

KevClark64
Wed Jun 25 15:41:53 CDT 2008

The easiest way to just play one sound is probably to use the
sndPlaySound function. You can find an explanation of using it with
Foxpro here: http://www.news2news.com/vfp/?function=398

Alternatively, you could use a multimedia OCX to play sounds, but that
is probably overkill in this case.

Regards,
Kevin Clark

Re: sound by Rush

Rush
Wed Jun 25 15:49:09 CDT 2008

sherry wrote:
> Hi
> Can I play a .wav sound on app opening.
> I'm using vfp8.
> What and where do I put the code?
>
> Thanks
> Sherry

Try the following either early in your main program or in your main
(opening) form.load event:

SET BELL TO "MySound.WAV"
?? CHR(7)
SET BELL TO

It should play as soon as the program starts.

If you want to delay it till your main form (if any) is open, use
the form.init event. That code doesn't run until after all of the
form's objects are created.

- Rush

Re: sound by Gerhard

Gerhard
Sat Jun 28 17:48:42 CDT 2008

The code from Rush should have a little addition which is:

SET CONS ON
SET BELL TO "MySound.WAV"
?? CHR(7)
SET BELL TO
SET CONS OFF

greetings Gerhard



"Rush Strong" <rush.strong@[DELETEME]verizon.net> schrieb im Newsbeitrag
news:eTTHsTw1IHA.3920@TK2MSFTNGP02.phx.gbl...
> sherry wrote:
>> Hi
>> Can I play a .wav sound on app opening.
>> I'm using vfp8.
>> What and where do I put the code?
>>
>> Thanks
>> Sherry
>
> Try the following either early in your main program or in your main
> (opening) form.load event:
>
> SET BELL TO "MySound.WAV"
> ?? CHR(7)
> SET BELL TO
>
> It should play as soon as the program starts.
>
> If you want to delay it till your main form (if any) is open, use the
> form.init event. That code doesn't run until after all of the form's
> objects are created.
>
> - Rush



Re: sound by sherry

sherry
Mon Jul 07 20:00:00 CDT 2008

Hi
The other way worked fine...What is the SET CONS for?

Thanks
Sherry

"Gerhard Gentele" wrote:

> The code from Rush should have a little addition which is:
>
> SET CONS ON
> SET BELL TO "MySound.WAV"
> ?? CHR(7)
> SET BELL TO
> SET CONS OFF
>
> greetings Gerhard
>
>
>
> "Rush Strong" <rush.strong@[DELETEME]verizon.net> schrieb im Newsbeitrag
> news:eTTHsTw1IHA.3920@TK2MSFTNGP02.phx.gbl...
> > sherry wrote:
> >> Hi
> >> Can I play a .wav sound on app opening.
> >> I'm using vfp8.
> >> What and where do I put the code?
> >>
> >> Thanks
> >> Sherry
> >
> > Try the following either early in your main program or in your main
> > (opening) form.load event:
> >
> > SET BELL TO "MySound.WAV"
> > ?? CHR(7)
> > SET BELL TO
> >
> > It should play as soon as the program starts.
> >
> > If you want to delay it till your main form (if any) is open, use the
> > form.init event. That code doesn't run until after all of the form's
> > objects are created.
> >
> > - Rush
>
>
>