|
Post by honky on Mar 26, 2021 14:39:04 GMT
Good morning all, How do I play a ".wav" for a determined time: "T" (the "wav'time origin" longer than: "T")? Timer ...? ? ? Thank you for.
|
|
|
Post by Rod on Mar 26, 2021 16:44:50 GMT
If the wav is shorter than your time interval then use playwave loop, if it is longer than the time interval you dont need loop. Playwave "" stops the wave at the timer interrupt. So yes you might need to have a timer running.
However you can create various lengths of .wav, with Audacity for example. Then you dont need the timer and you can still cut it short with playwave ""
|
|
|
Post by honky on Mar 26, 2021 17:59:46 GMT
If the wav is shorter than your time interval then use playwave loop, if it is longer than the time interval you dont need loop. Playwave "" stops the wave at the timer interrupt. So yes you might need to have a timer running. However you can create various lengths of .wav, with Audacity for example. Then you dont need the timer and you can still cut it short with playwave "" Okay, but where do I put the timer? I did several tests without being able to stop the sound.
|
|
|
Post by Rod on Mar 26, 2021 20:00:30 GMT
You should play your .wav with Audacity to see how long it plays for and how long a silent end it has. Some .wav files take a while to end. You can craft your own with Audacity.
This will play the default chime because it wont find the named file. The default chime takes a while to end so you need a long time lapse.
Shout if it is still confusing.
playwave "bump.wav",loop timer 5000, [stop] wait
[stop] timer 0 playwave ""
|
|
|
Post by honky on Mar 27, 2021 12:03:34 GMT
It's work fine. Thank you Rod.
|
|