Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System sounds
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00151382
Message ID:
00151400
Vues:
15
>>>Hello I'm working with VFP 5.0 and Win95/98
>>>
>>>Help please, I have a need to play system style beeps through the system speaker..... not a sound card.
>>>
>>>I know about setting BELL on and using ?? CHR(7). Now if I could have more than one sound or even repeating the BELL so I could have 1 beep for one event, 2 beeps for another and so on.
>>>
>>>Any help would be appreciated.
>>
>>Try this
>>
>>set bell to 'c:\winnt4\media\chimes.wav',2
>>??chr(7)
>>
>>
>>If the wav file does not exist, the default beep is used. The second parameter is the duration. Personally, I don't see a difference with the wav files I use.
>>
>>To sound twice just call ??chr(7) twice.
>>
>>
>>set bell to 'c:\winnt4\media\chimes.wav',2
>>??chr(7)
>>??chr(7)
>>
>>Hope this helps.
>
>I tried both of these, and as you said I see no difference in the duration, but even when I call it twice it only sounds once. I'm calling this in a function and if I call it twice[as above] I get an error when it runs. If I call it once it plays once.
>Wait, let me go pound my head on the wall..I've been at this to long.
>thanks for the advice though.

Hi Dave
Using set bell you can't call it again until it finishes playing.
Two answers.
1/Determine the length of the sound and wait in code the same period of time ( a real PITA, but that's what I did for an sound rich app)
2/Use shellexecute API to play it via some other app.
The duration parameter is essential, but ignored by Fox.
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform