Play a sound file on the web

I have a sound file that I want to play on my web page.

I have attached this file (12days.mid) as a file resource in the designer client - but how do I call it ??

I have tried this in the HTML head section but it doesn’t work:

“[BGSOUND SRC=/ptest/paultest.nsf/12days.mid loop=INFINITE>]”

Can anyone point me in the right direction ? If possible it would be even better if I could call it from the onload event or from a javascript function.

Thanks

Paul

Subject: play a sound file on the web

Hi Paul.

This is the right way and should work on any web server.

e.g.

Some problems that occur very often are:

  • blanks in the path or the file name

  • forgot to set path and file in quotes

  • Case sensitive filename problem

In this case, a “moin.wav” on the server would not be played.

JK

Subject: RE: play a sound file on the web

thanks for the response JK but no joy

can you give me a step by step guide as to:

where and how the .mid file should be stored,

and where and how the code to call it should be written?

thanks

Paul

Subject: RE: play a sound file on the web

Hi Paul.

Assuming you are working on a Windows Client machine, you copy test.mid to C:\ and create test.html with the following content in the same directory (C:):

Testing the sound…

After having succeeded in starting test.html on your local drive (with hearing the midi-file) you just copy these two files to your web root directory on you Domino (or any other) web server. (In my case: C:\Domino\Data\domino\html)

If your webserver is running on a linux or IBM machine, keep in mind that the file name is case sensitive.

HTH,

JK

Subject: RE: play a sound file on the web

Thanks for coming back so quickly JK.

One more question, is there a way to attach the music file to the notes database in designer ?

Cheers

Paul

Subject: RE: play a sound file on the web

You can do this several ways. Attach it in the files area (if they’re to be fixed files) and then use a url to point to it, or if they are not, and users are going to attach them. Create a form with a file upload control on it.

Subject: RE: play a sound file on the web

Thanks Joel,

Could you give me an example of the URL that I need as that is where I started and where I am stuck !!

what should I change this to:

“[BGSOUND SRC=/ptest/paultest.nsf/12days.mid loop=INFINITE>]”

Cheers

Paul

Subject: play a sound file on the web

Don’t forget that bgsound is IE only, I think you need to tag to get it working in firefox etc.

Dan