On 26 Mar, 02:01, "alice" <a...@fearofdolls.comwrote:
I'm trying to get sounds to play on image mouseovers using dreamweaver
8, and I found out that the code it generates to do this only works
for IE. Is there a way to do this so that it will work with most of
the popular browsers? I don't care if it can be done with dreamweaver
or if I have to hand code or copy code from somewhere, I just want it
to work.
Here is what DW creates
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
if mp3 files you /could/ do this using a hidden iframe, and just
dynamically set the src attribute to a flash player with autostart
enabled.
http://musicplayer.sourceforge.net/ would be useful here.
you could use lame to change from wav to mp3. (-mm mono)
lame --priority 1 --resample 22050 -b40 -mm audio.wav audio.mp3
while mplayer or vlc would probably convert from mid to wav/mp3 as
well
I know this isn't a pretty method but it can work well.
I use a README in conjunction with apache fancy indexing to provide a
javascript function which attaches to all links of mimetype mp3,
setting the target of the link to point to an iframe of this type in
the README include, then I can just use standard apache indexing to
provide browseable interface to stream the colleciton.