Warning | |
---|---|
This tag is obsolete. Its functionality has been replaced by
the <resource> tag.
|
The <resource>
tag defines another way to import a
sound into an application. The <resource>
tag can
also be used to import images and movies.
The <audio>
tag imports an audio file. The file
is included in the application when the application is compiled. The
tag has a required src
attribute. The value of
this attribute is a filename, that is resolved relative to the source
file that contains the <audio>
tag. The file should
contain an mp3 file.
The LzAudio
service can be used from
JavaScript to play the clip. The string that is passed to the
LzAudio.playSound
method should match the value of
the name
attribute of an
audio
tag.
<canvas
height
="150
">
<audio
src
="resources/poof.mp3
" name
="poof
"/>
<button
text
="Poof
" onclick
="LzAudio.playSound('poof');
"/>
</canvas
>
Also see the audio example.
The audio clip must be an MP3 file at one of the following sample rates: 11.025 khz, 22.5 khz, and 44.1 khz, and encoded at no more than 160kbps.
Copyright © 2002-2010 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.