-
[RESOLVED] creating a uniform delay of n seconds between the sounding of two words.
hi all !
So I have another problem that I am stuck with.
I have the sound files of the following words.
pre, vent, ed, lift, seed, as
pre.mp3, vent.mp3, ed.mp3, lift.mp3 etc
and I wish to use these to make the computer to call out the following words.
prevented, lifted, seeded, preceded. So I have broken these as:
1. pre-vent-ed
2. lift-ed
3. seed-ed
4 pre-seed-ed ( This would be the same sound as preceded)
I have stored each of these words in a string which i convert into an array by exploding it before passing the array to
a pn_sound function.
The pn_sound function checks to see if all words have been called out and if not calls another function ok_sound
ok_sound takes the sound array for each word for e.g. for pre-vent-ed it would have the sounds arr[0] = pre, arr[1]=vent, arr[2] = ed.
It then creates a new sound object (s = new sound() and attaches the first sound ( arr[0] = pre) to it,
s.attachsound(arr[0]);
s.start // and plays the sound.
s.onsoundcomplete then checks to see if there are more bytes in the array to complete the sound of the word. If so it attaches the next byte and calls s.start again to play the sound thus forming a recursive function.
Thus onsoundcomplete recurses till all bytes have been played and the sound for the word completed.
Now is the time to fetch the next word and play it and so on till all words have been played.
What I want is that irrespective of the time it takes to play each word, THERE SHOULD BE A CONSTANT GAP BETWEEN ANY 2 WORDS. so
once a words has been played, the program should wait for say 3 or 4 seconds before it fetches the next word and plays it.
Please can someone show me how I can achieve this.
Thanks loads all !
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|