Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > ‘Sound Preview’ for a Novice

‘Sound Preview’ for a Novice
Thread Tools
Dedicated MacNNer
Join Date: Apr 2002
Location: Chicago
Status: Offline
Reply With Quote
Apr 27, 2003, 03:10 AM
 
I’m trying to put a sound file ‘download page’ together and my lack of HTML knowledge is causing me some problems. Since I’m very new to HTML, I’m trying to keep my pages W3C compliant - I figure its best to learn it correctly from the start, instead of having to relearn it the right way.

So, here’s what I’ve got so far...

I want to give the user an option to preview the sounds, before downloading them, without leaving the original page. I tried to use the OBJECT element to embed mp3s as the preview. As I see it, this has two main problems.
1. If I make a page with 50 sound files, those 50 mp3 samples need to be accessed / downloaded (sorry I’m probably not using the right term there) in order for the page to load. That could take quite a while, especially for dial-up.
2. To keep all the mp3s from playing automatically, I added this : autostart="false". Although it works for Netscape 7.02 and IE 5.1.5 running on OS 9.1, autostart is not a valid attribute and it didn’t work correctly from Windows 98 (I checked using Netscape and IE via Virtual PC).

If you want to see it, here it is : http://speckledstone.home.attbi.com/...udio_test.html

I thought about bending my rule on W3C compliance and making a separate page for Mac downloads, but that still doesn’t solve the first problem.

Does anyone have a suggestion that could solve my problem within the realm of HTML?
     
Dedicated MacNNer
Join Date: Apr 2002
Location: Chicago
Status: Offline
Reply With Quote
Apr 27, 2003, 03:17 AM
 
One more thing...
As I see it, my only solution is to have direct links to the mp3s. If this is my only option, I would like your opinion. Should I force a new window to open for the preview, or should I leave it ‘as is’ and let the user use the ‘back’ button?

Example : http://speckledstone.home.attbi.com/...k_to_mp3s.html
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 27, 2003, 05:57 AM
 
Yep, I think you're on the right track to begin with. Just keep your page as a list of links, whereby you follow a link to either a 10-15 second 'preview' mp3 file which is low quality, or a download link to the 'full-size' mp3.

I would also launch each link as a new window to save to-ing and fro-ing between pages. Here's a wee bit of Javascript I use to make a pop-up that's friendly to both Javascript and Non-Javascript enabled browsers:

[php]
<script type="text/javascript" language="Javascript">
// <![CDATA[

function launchURL(url) {
scrx = screen.width;
scry = screen.height;
winWidth = (scrx > 800) ? 832 : 760;
winHeight = (scry > 600) ? 500 : 400;
winX = (scrx/2)-(winWidth/2);
winY = (scry/2)-(winHeight/2);
enlargementWin = open('','preview','directories=no,location=no,menu bar=no,status=yes,titlebar=no,toolbar=no,scrollbar s=yes,width='+winWidth+',height='+winHeight+',left ='+winX+',top='+winY+',screenX='+winX+',screenY='+ winY+',resizeable=no');
enlargementWin.moveTo(winX,winY);
enlargementWin.location=url;
enlargementWin.focus();
return false;
}

// ]]>
</script>

<a href="preview.html" target="preview" onclick="return launchURL('preview.html')">Listen to preview</a>
[/php]

It simply launches a pop-up window to a size you specify (winWidth/winHeight) and automatically centres it. Rather than force a URL of 'javascript:launchURL' like some sites, this allows the 'onclick' event to take over if the browser allows javascript, otherwise the bog-standard window will open with the link.

Hope this helps.
Computer thez nohhh...
     
Mac Elite
Join Date: Oct 2000
Location: Baltimore, MD
Status: Offline
Reply With Quote
Apr 27, 2003, 10:10 AM
 
Yeah, I'd say just have a link to a preview too, having 50 mp3's even short ones, that start being downloaded once you access the page is just begging for problems. Plus I reckon some browsers might just get overloaded and crash.
     
Dedicated MacNNer
Join Date: Apr 2002
Location: Chicago
Status: Offline
Reply With Quote
Apr 28, 2003, 06:24 PM
 
Nice script Simon, that could come in handy. JavaScript doesn't seem as difficult as I thought. It looks like a decent working knowledge of Apple Script is more than enough of a foundation to learn JavaScript. I guess I'll check out some tutorials on the web and see what else I can do with it.

Thanks for the advice guys.
     
Mac Elite
Join Date: Sep 2000
Location: Baltimore
Status: Offline
Reply With Quote
Apr 30, 2003, 12:47 PM
 
That is a nice script, Simon.

I know this won't help you much, Speckledstone, but I just wanted to mention my favorite 'sound preview' design. It's on the Flash site Flashkit where they have hundreds of free SFX and loops. The previews are all done in -- not surprisingly -- Flash, and next to each they give detailed info about the sample. Very well done. I use them whenever I need a sound.

Here is a sample of some of their listings (arcade sounds). Just click each little 'play' arrow to hear a low-res sample of each file.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:27 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2