ajetrumpet
Banned
- Local time
- Yesterday, 21:26
- Joined
- Jun 22, 2007
- Messages
- 5,638
Play VB/HTML .Wav (Wave) Files
Here is some code you can use to play .Wav files in your database:
Play your .Wav files using the "MusicPlay" variable:
I incorporated some background voices on a website recently, so I'll add the small piece of code I used to play .Wav's on the webpages too...
This script goes before the BODY tags:
This is the start of the BODY tag:
Here is some code you can use to play .Wav files in your database:
Code:
Option Compare Database
Option Explicit
Public MusicPlay As Long
Public Const SND_SYNC = &H0
Public Const SND_NODEFAULT = &H2
Declare Function SndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Code:
Function PlayFile()
MusicPlay = SndPlaySound("FULL PATH OF .WAV FILE", SND_SYNC + SND_NODEFAULT)
End Function
This script goes before the BODY tags:
Code:
<script type="text/javascript">
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>
<embed src="FULL PATH AND EXTENSION OF FILE" autostart=false loop="false"
width=0 height=0 id="sound1" enablejavascript="true">
Code:
<body onLoad="EvalSound('sound1');"
Last edited: