locus sonus > audio in art





locus sonus > Help Media mp3

Last changed: 2009/02/15 03:06

 

{tags:Help, Syntax, Lionwiki}

MP3 embed with QT

To embed a mp3 soundfile



 ^html^<object data="http://simplythebest.net/sounds/MP3/sound_effects_MP3/sound_effect_MP3_files/bee.mp3" 
type="audio/mp3" width="300" height="16">
<param name="src" value="http://simplythebest.net/sounds/MP3/sound_effects_MP3/sound_effect_MP3_files/bee.mp3" />
<param name="controls" value="console" />
<param name="autostart" value="false" />
<param name="loop" value="0" />
<param name="volume" value="100" />
</object>^/html^ 





MP3 embed with Flash

To embed a mp3 soundfile with dewplayer

The mp3 soundfiles are automatically read with the help of a light flash player : dewplayer (only 4k).

You need to first install the flash player. Download it here : http://www.alsacreations.fr/dewplayer .

Put this file in the same directory than index.php. Replace the exact url of the dewplayer location into the mp3 player string into the index.php.

Thus you can upload your mp3 files thanks to the Upload plugin. They will be available on the Data folder.

Syntax :

^=data/mp3/yourfile.mp3^ (put = before the url)

Example :




With external http soundfile links, you can use the same wiki code if you're not using openwindow scripts for http links in the index.php files.

The alternative way is to use ^html^ embed like this :

 ^html^
<object type="application/x-shockwave-flash" 
data="http://www.yourserver.com/LionWikidirectory/dewplayer.swf?mp3=http://www.server.com/path/file.mp3&showtime=1" 
width="200" height="20">
<param name="wmode" value="transparent">
<param name="movie" 
value="http://www.yourserver.com/LionWikidirectory/dewplayer.swf?mp3=http://www.server.com/path/file.mp3&showtime=1" />
</object>
^/html^ 



here is an example with a soundfile :



Another version of the player permits to play sound playlists :

dewplayer-multi.swf


In this version, you must put the soundfile list like this (separated by a pipe) :

/media/sounds/test.mp3|/media/sounds/test2.mp3|/media/sounds/test2.mp3 etc.



Features :

- mp3 tags are recognized and are played by the player during the listening

- &autoplay=1 → automatic play

- &autoreplay=1 → loop

- &showtime=1 → show time in mn:sec

- &volume=80 → selected volume

- &randomplay=1 → random play (with dewplayer-multi.swf)

- &nopointer=1

- &bgcolor=CCCCCC → specify the background color (without #)



Here is the full code for embedding (even if the example above works too)

(example with classic dewplayer)

 ^html^
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" 
width="200" height="20" id="dewplayer" align="middle">
<param name="wmode" value="transparent" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="dewplayer.swf?mp3=test.mp3" />
<param name="quality" value="high" />
<param name="bgcolor" value="CCCCCC" />
<embed src="dewplayer.swf?mp3=test.mp3" quality="high" bgcolor="CCCCCC" width="200" height="20" 
name="dewplayer" wmode="transparent" align="middle" allowScriptAccess="sameDomain" 
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
^/html^ 



Another flash jukebox mp3 player is available here :

http://jeromejoy.org/





To embed a mp3 soundfile with swfplayer 2

http://code.google.com/p/swfobject/ (english doc)

http://egypte.olympe-network.com/swfobject-francais.html (french doc)







 ^html^<script type="text/javascript" src="http://locusonus.org/webs/js/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.sonDepart = "http://www.animalpicturesarchive.com/animal/SOUND/animal_sounds_17-dolphin.mp3";
flashvars.titreDepart = "Dolphins+sea";
var params = {};
params.quality = "high";
params.play = "false";
params.loop = "false";
params.bgcolor = "#000000";
params.allowfullscreen = "false";
var attributes = {};
attributes.id = "lecteur";
swfobject.embedSWF("http://locusonus.org/w/lecteur.swf", "lecteur_contenant", "632", "28", "9.0.0", false, flashvars, params, attributes);
</script>
<div id="lecteur">
<p id="lecteur_contenant"></p>
                </div>^/html^