winzip icon

MP3Tool.web - Stream Your MP3s

Email
Submitted on: 1/5/2015 1:22:00 PM
By: TheFrogPrince (from psc cd)  
Level: Beginner
User Rating: By 10 Users
Compatibility: ASP (Active Server Pages), HTML, VbScript (browser/client side)
Views: 784
 
     O.K. This little web comes to you from a VB developer who just very recently began the cross-over into web development. What this web does, in essence, is allow you stream your MP3 library from anywhere on earth. =) This little web has caused me to seriously consider getting a cable modem... since my DSL is capped out at 15K/sec. =( Anyways... this web is an interface to my MP3 library. It is data driven and links to the same database that is used by my desktop version MP3Tool (my own creation... beta download here: http://members.tripod.com/thefrogprince/ ). The page interface makes use of frames, a treeview, a listview (poor man's grid), and a little ADO+XML. This is most definitely an IE5 or better web, as the XML features employed were not available in previous versions of ADO. Anyways... the search frame takes the input, formats the SQL, and loads the global search results recordset. On the NodeClick of the treeview, we populate our "grid". I'm using the listview because it seemed to be the only grid-like thing I could count on being there with the IE5 install. Double click on the treeview node or file or files in the listview to being streaming the files. The streaming technique employed is similar to the one posted by Ron Light. To understand what happens, you need to know the database format. A screen shot of the diagram can be see here: http://members.tripod.com/thefrogprince/Graphics/ssMP3ToolDB.jpg A copy in Access2000 format is also in the ZIP download. Basically... every song in my database is assigned a 32 character unique key. So this is what we load as the "Key" value for the items in the listview. When we double click on a file, this key is passed up to the active server page on the server which reloads the record (or records) and copies this MP3 files into a temporary directory called \Downloads off your web. On Windows 2K, this does require messing with some directory permissions to get to work... because the \Downloads directory needs to be publicly visible and the web user will need permissions to copy files into this folder. (Restrict everything else). Haven't tried it with Windows 98... but I imagine you wouldn't have the same issue. This web should also run Personal Web Server 4. The rsGet function demonstrates 3 different ways of returning ADO recordsets over an XML stream... the default being the common method that can be run on Personal Web Server or IIS5. Anyways... once the file or files have been copied into the public downloads zone... an M3U file is built pointing to files from a public perspective... and passed back as the result of the .ASP. So far... this has only been tested with MP... but both MP 6.4 and MP 7 work. Ideally... I wanted to return the MP3 file directly as a stream from the ASP... but could not figure out how to stream back binary data. If someone knows how to stream binary data back from an ASP page... please send me an e-mail and let me know... or better yet... post it as a reply to this article. =) Share with the entire class. =) Lastly, as you will see, this web demonstrates working with client-side disconnected ADO recordsets. It's read-only right now... I'm currently working the update part. =) All "binding" of data to controls is done on this web manually, but the project I am doing at work right now, is a bit more involved and I am currently working on a scheme using an ActiveX DLL written in VB to "bind" basic html elements like TextBox and Checkbox to a disconnected ADO recordset. I've come up with a scheme that appears to be working... but I'm not sure enough of it yet to post it. If you've had to tackle the same issue (data binding disconnected ado recordsets on a web page), I would really appreciate it if you could toss a quite note my way (thefrogprince@hotmail.com) explaining how you finally solved the issue. =)

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :MP3Tool.web - Stream Your MP3s
'**************************************
http://www.planetsourcecode.com/xq/ASP/txtCodeId.6215/lngWId.4/qx/vb/scripts/ShowCode.htm
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.