View Full Version : Audio previews - multitrack?

05-27-2004, 05:56 AM
I tried making a JavaScript to do this, but I failed miserably. Then I searched for a working script I could modify, and found a few but none seem to work right when I modify them. So either what I want to do is difficult to do or I am just being moronic. I'll leave the voting on that issue for later - for now I would just appreciate a bit of help figuring this out ;)

I am setting up a page to sell some CD's for a friend who is a recording artist. He wants to have a no-download, 30-second preview of each track playable in the browser. I thought of flash, but we want to avoid any plug-ins. I tried plain old HTML, but it sets you up to download the .wav or the .mp3.

So the basic desired layout of the page is this; CD picture with shopping cart buttons to the right of it, under it are the names of the tracks of the cd. Clicking the name will play a 30-second clip, no pop-up, no download, no plug-ins; and fully cross-browser compatible.

Also, in addition to multiple tracks for the CD, there will be multiple CDs listed on the page, each with multiple tracks. I can get one audio clip to work, but when I add in more than one, it doesn't seem to work right. Is that possible?

Finally, if the above is possible, is there a way to 'loop' the tracks, so that an option to listen to all tracks from one CD could be added as well? That is just extra, but I thought it would be a nice touch. Like a 'play all' link after the last track that will play track 1, immediately play track 2, etc. I am thinking I may just edit the audio files to have one longer .wav or .mp3 which has all the tracks in one file, but it would be more disk-efficient to just play them in order.

Thanks for any help you can provide!

05-27-2004, 02:26 PM
when you say no download are you refering to save as functionalities or are you saying you want to stream the files to the user.?

05-27-2004, 02:34 PM
I want it to be streamed - as it is only a 30 second preview clip, I do not mind if they choose to download it - but if I were to just directly link to a wav or an mp3 file, then half the browsers would get a download dialogue just trying to listen to it - that is what I want to avoid.


06-05-2004, 09:30 AM

Willy Duitt
06-05-2004, 01:29 PM
Did you try converting the preview clips to MIDI format?

06-05-2004, 07:56 PM
I thought of doing that, since I have seen several MIDI jukeboxes I could use, but since this is to promote a CD, and has audio as well as music, and since MIDI format quality generally sucks for anyone with a low-end soundcard or on-board sound (to my knowledge...please correct me if I am wrong on that) - I thought I should not do that.

06-06-2004, 03:54 AM
Try this:


function playSound() {


<bgsound id="bgsound">

<select id="mp3" size="5" onchange="playSound();">
<option value="track1">Track 1
<option value="track2">Track 2
<option value="track3">Track 3
<option value="track4">Track 4

jeeze ive posted that code a lot in these forums... to see what it does go here (http://www.freewebs.com/death_by_monkeys/glow%20test.htm)

06-06-2004, 05:44 AM
DooM_MonkeY you code doesn't work for me in Mozilla Firefox.

06-06-2004, 06:51 AM
o im sorry it might only work in IE5 cause thats what I have

where there is "value" you did put the url's didnt you? or is it because of the bgsound tag?

06-06-2004, 06:42 PM
Doesn't work in IE6 either...better quit posting it.

06-06-2004, 07:15 PM
it might just take a while to load, because it works just fine on mine, you know to put the url in the value right? (you probably do im just checking), but yeah, it is probably because it takes so long to load the dang song