PLaying multiple .WAV files when page loads 
Author Message
 PLaying multiple .WAV files when page loads

I want to create a dynamic HTML page that displays a series of
instructional statements that are associated with .WAV files that
'speak' the same words as the text.  Each section of text will have
its own .WAV file.

Is there a way that I can play a series of .WAV files when the page
loads.  Could this be done through a VBScript function and then have
the OnLoad call the function.  Is there an equivilant to the Windows
sndPlaySound function that I can use within a VBScript function?

Any help appreciated.

-Shawn



Wed, 31 Mar 2004 04:30:16 GMT  
 PLaying multiple .WAV files when page loads

Quote:

> I want to create a dynamic HTML page that displays a series of
> instructional statements that are associated with .WAV files that
> 'speak' the same words as the text.  Each section of text will have
> its own .WAV file.

> Is there a way that I can play a series of .WAV files when the page
> loads.  Could this be done through a VBScript function and then have
> the OnLoad call the function.  Is there an equivilant to the Windows
> sndPlaySound function that I can use within a VBScript function?

> Any help appreciated.

> -Shawn

See the attached VB Script for a sound subroutine.  This may give you
enough of an idea to accomplish your task.

Dim wshSound            ' Sound Object  Copy to your script main function

Dim SoundArray(15)      ' Copy to your Script main function
Dim SoundNum            ' Copy to your Script main function

Public Sub InitSound()          ' Append to the end of your Script main
function

'  Initialize sound files.      ** The list may be changed based upon
your sounds. **
'                               ** Note:  If available to others, keep it simple. **
'                               ** The list may include music and videos when using mplayer2. **

        SoundArray(0) = "\media\Start.wav"
        SoundArray(1) = "\media\ringout.wav"
        SoundArray(2) = "\media\ringin.wav"
        SoundArray(3) = "\media\chimes.wav"
        SoundArray(4) = "\media\chord.wav"
        SoundArray(5) = "\media\ding.wav"
        SoundArray(6) = "\media\tada.wav"
        SoundArray(7) = "\media\The Microsoft Sound.wav"
        SoundArray(8) = "\phasers.wav"
        SoundArray(9) = "\media\Office97\Reminder.wav"
        SoundArray(10) = "\media\Office97\Type.wav"
        SoundArray(11) = "\media\Office97\Whoosh.wav"
        SoundArray(12) = "\media\Office97\Laser.wav"
        SoundArray(13) = "\media\Office97\Camera.wav"
        SoundArray(14) = "\media\Office97\Driveby.wav"

        Set wshSound = CreateObject("WScript.Shell")
End Sub

Public Sub MakeSound(byVal SoundNum)            ' Append to the end of your
Script main function

Dim WaveFile

        WaveFile = "%windir%" & SoundArray(SoundNum)
        wshSound.Run "sndrec32 /play /close " & WaveFile, -1, False       ' Use
this one for .wav files only
'       wshSound.Run "mplayer2 /play /close " & WaveFile, -1, False       ' Use
this one for any media file

'                                 -1 indicates no window shown, False
indicates release and continue immediately
                                   0 indicates window shown,    True indicates wait For completion to
continue

End Sub



Sat, 03 Apr 2004 02:58:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Play multiple wav files from VB

2. Playing multiple WAV files

3. How do you play MULTIPLE wav files.

4. Play multiple wav-files simultaneously

5. Playing multiple sound (wav) files at once

6. playing multiple wav files

7. Playing multiple WAV files

8. Can I play multiple WAV files ?

9. PLAY MULTIPLE WAV FILES with WINAPI?

10. .vbs file to play a .wav if file size does not equal 0

11. Playing a .wav File from a .vbs File

12. Playing a WAV file in VBscript

 

 
Powered by phpBB® Forum Software