Control MIDI or WAV file using Javascript
How can you control midi or wav files using JavaScript?You should use the EMBED tag. Found at http://www.irt.org
AI
Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Kaynak Kod
Upload
The following will play the midi or wav file as soon as its loaded:
<HTML>
<BODY>
<EMBED SRC="sound.wav" HIDDEN=TRUE>
</BODY>
</HTML>
The following allows you control when it plays:
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript"><!--
function playSound() { document.firstSound.play(false); }
function pauseSound() { document.firstSound.pause(); }
function stopSound() { document.firstSound.stop(); }
//--></SCRIPT>
<A HREF="javascript:playSound()">Play the sound now!</A><BR>
<A HREF="javascript:pauseSound()">Pause/Restart the sound</A><BR>
<A HREF="javascript:stopSound()">Stop the sound</A><BR>
<EMBED SRC="sound.wav" HIDDEN=TRUE AUTOSTART=FALSE LOOP=FALSE NAME="firstSound" MASTERSOUND>
</BODY>
</HTML>
You can replace sound.wav with sound.mid.
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı