Click to See Complete Forum and Search --> : Playin short audio on webpage - specifics


gadyb
01-05-2006, 12:50 PM
Hello,

New here, hope it'll be good.

I'm a 30 year old Israeli, Jerusalem, programmer by trade (algorithmics, not much of a web or multimedia guy), into Alternative Music and Tibetan Buddhism.

I want to play a very short audio track on my homepage, http://thaye.net (you're welcome to look). I want it looped, I want it good quality, I want it low volume, I want it cross-platform, and I do not wish a popup for an audio software download to appear - if they don't have a way to play it, just forget it.

I know it's a lot to ask, but I believe it's possible.

http://www.plainsong.net/ has an example with what I need. I actually need the first few seconds of the opening of this very song in its studio version, The Cure's Plainsong in Disintegration, my favourite track in my favourite album by my favourite band. However, I don't know how cross-platform Quicktime is (though I prefer it to microsoft stuff, if possible, if not then it's ok), it puts a white dot on my screen, and I believe it will popup if the viewer has no QT installed. Furthermore, when I try to convert this from the CD into a .mov audio file with my quite serious audio software, there's a hiss.

I tried .wav, but these mere few seconds take 4Mb. Can wav be lower quality? is it platform-independent?

I really hope you can help me, it wil be very much appreciated.

Thank You very much, :)

gady b

lukercp
01-05-2006, 02:39 PM
convert your file to wma, then upload..


its plays very quick full quality and has no promt,

see how fast it is,
very fast!

here is code:
<object id="MediaPlayer1"

classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"

codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,7

01" standby="Loading Microsoft Windows® Media Player components..."

type="application/x-oleobject" width="0" height="0">
<param name="fileName"

value="http://yoursite.WMA">
<param

name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param

name="autoStart" value="true">
<param name="showControls" value="false">
<param name="Volume"

value="-10">
<embed type="application/x-mplayer2"

pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"

src="http://yousite.WMA" width=0

height=0 autostart=1 showcontrols=1 volume=-20></embed>
</object>

gadyb
01-05-2006, 06:40 PM
lukercp,

Thank you so much!

...a genuine religious dialogue ;) (I'm into Tibetan Buddhism).

...and I didn't know Clapton's sad song had this nice version.

It works wonderfully.

There are some minor problems, but if you don't have the time please don't bother, I'll find them out somehow, I believe. Please read on only if you can give quick answers and I won't be wasting your time.

I want it to repeat for lets say 7 times, 21 seconds X 7, I don't want to drill a hole in their head, but I played around with the 'loop' and 'PlayCount' variables and it doesn't work. I tried adjusting the CLSID to a newer version (you gave me for Media Player 6.4 I think, but no worry, newer versions are backward compatible), but with the new one this nagging small dot appears on my black background, and I couldn't adjust the number of repetitions here either.

The wma is indeed very small, and there's hardly a hiss, but when the file starts to play there's some crackling sound, not terrible, and it's there every time the 21 second sound segment repeats. Is it the sound card or something?

I also couldn't manage to change the volume, no matter what value I put in it sounds the same...

...and isn't it redundant to put my filename twice into the code?

Also, are you sure if the browser doesn't support it it just won't play instead of notifying a needed download or something? I put standby="..." instead of the Media Player notification, so even if it will appear it won't be intrusive on my content.

..and is it platform independent?

You can see my code for yourself, it's the default index.html at http://thaye.net

Thanks a lot! I probably would have eventually discovered it myself, buy you saved me hours.

regards,

gady b

lukercp
01-06-2006, 09:28 AM
yes the song tears in heaven is a new version by the choirboys (http://www.thechoirboys.co.uk)
as for your song, its best to try and not loop the song but copy it 7 times.
for example make the code loop=false

but.. when you convert to wma drag the file in 7 times and click save as high quality.
this will play it 7 times and stop.

if you have a web server save your song under media.yoursitename.com/songname.wma this stops download theft. :)

wma is the ultimate is streaming video and audio without broadcasting it which costs to much, its a cheap and very good quality option.
some people use flash but not everyone has flash and it promts to much so this is why i love wma files :)

If you have any questions let me know when i get back in tonight i will be able to give you a more longer answer.

take care


the dot in the background is to stop the song, it can be removed also by changing the code.


ANOTHER CODE: change your name for song:
also remove controls if needed

<object id="player1" width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="http://yoursite.WMA">
<param name="uiMode" value="full">
<param name="autoStart" value="false">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="300" height="44"
src="http://yoursite.WMA" enabled="0" autostart="0" loop="true"></embed>
</object>

vandamme
01-06-2006, 11:34 AM
:confused: Well, I want to do the same thing basically: I have a church website and I captured a short movie on my digital camera at choir practice, stripped the audio off (using some freeware which I forgot the name of) and edited it (using Audacity) to length and so on, and wanted to put a button on the page to start it, so that folks with dialup would be able to choose to hear it or not. Well, when I go to your site I get no audio, just a stalled progress bar. :( Reason: I belong to the Church of Mozilla, where the name M******** is anathema. :mad: Looking at your code, I see the Mark of the Beast in it (Active-X).

jim

lukercp
01-06-2006, 11:45 AM
i dont understand, noone has a problem viewing and listening to that page, it is well tested.

not sure about us folkes.
whats the issue with active x, i am safe :)

gadyb
01-06-2006, 12:41 PM
lukercp, thanx a lot!

Unfortunately, I'm at my mom's on weekends, and can't really do stuff from here, I'm also involved with something a bit urgent, but I'll definitely check it and get back to you. When you say copy it 7 times, do you mean make an audio file that is 7 times as long? It is 90k as it is, so I don't want to make it bigger, the entry page has no content and people will usually stay there only for a few seconds, so I want them to hear the music asap. Perhaps you mean to play it in the code 7 times, that sounds like just what I need, I'll try it. Do I have to copy and paste the whole thing or can I leave the parameters as they are and copy only a few commands?

jim, I don't know about mozilla: I tested it, in addition to Explorer, on FireFox (it's Mozilla, isn't it?) with Windows XP and it works fine, only it doesn't repeat itself after 1 run, whereas IE does, with the very same code. A friend who has linux tried it with 3 different browsers, including FireFox, and they all failed, which doesn't surprise me, since linux and Windows Media Player don't sound like a lovenest. lukercp, did you check your site on a linux and/or mac as well? What I did (back in my own home) until I find a solution to linux is put a javascript code that comments the whole audio thing out for non-windows OS: I prefer no audio at all in these cases to icky messages and prompts about plugins and whatnot. You can see the page source and use what I did.

Anyway, I'll check it soon, hopefully Sunday, and get back to you.

Very much appreciated, honestly!

gady b
http://thaye.net

vandamme
01-06-2006, 02:08 PM
Hmmm, I'm using Mozilla 1.7.12, I tried everything I could think of (IE plays it OK), so I'll go home and try Firefox. Here @ work the Net Nerds keep a tight lid on things that run external code so I think they stopped the ActiveX stuff. But how...?


jim

vandamme
01-09-2006, 04:19 PM
I still can't figure out why the audio on your page doesn't work on my machine at work, but I got the code to work on my page:
http://users.churchserve.com/ny/stmary/colorsofgrace.html
I put in an extra link for folks who can't use the Media Player link, and changed the parameters so it doesn't automatically load the lengthy mp3 file.

So far I've gotten a report of the audio not working from the choir director. After careful analysis, I found that her computer doesn't have speakers...

jim

vandamme
01-15-2006, 10:38 PM
Well, I tried your first code (the longer one) substituting a mp3 for the wmv. That worked great with Firefox. So did a simple link from a button. Well, on IE it didn't, so I tried the second program above, and converted to wmv. The player buttons refuse to show full size though on IE. :confused:

Moving on to more worthwhile stuff. This internet thing will never catch on.