Computing.Net > Forums > Web Development > Audio Streaming - PHP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Audio Streaming - PHP

Reply to Message Icon

Name: Palookaville
Date: December 1, 2005 at 10:24:10 Pacific
OS: XP Pro
CPU/Ram: Athlon 2800+ / 1G
Comment:

Need urgent help for a uni project!

We have to design an eccomerce site that sells cd's. One of the functions of the site is that, when the user searches for a song/artist, it will bring up the results. Ok so this is not so bad to do, bit of php and mysql. But it also needs to bring up a 30 second sample of the track.

My question is:

How do I store 30 sec samples in my mysql database, so that a user can click on them when they do a seach etc...?

How do I stream these 30 sec samples. Do I need to set up a streaming server (e.g. shoutcast, icecast), or can i convert the 30sec mp3's to say realmedia (.ram) format?

It's not that I have left this till the last minute, but that we have only been taught very basic stuff, for a project that requires a little more than the basics. Being new to php and mysql, it has taken me time to set up the database and forms etc...

Any help will be much appreciated.




Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: December 1, 2005 at 11:45:18 Pacific
Reply:

You *could* store the 30 second clip in the database, but why make it more complicated than it has to be. instead, for each track in the database include a field for the path to the clip.

There are several options for the format of the clip. I don't have much experience with streaming. But, if you use MP3s your link to play the clip should dynamically create a playlist with the path of the clip.

Hope this helps.

Michael J


0

Response Number 2
Name: Dr. Nick
Date: December 2, 2005 at 01:10:02 Pacific
Reply:

I agree with Michael. Don't bother trying to put binary audio data in the database, just store the file someplace that makes sense.

Does the audio have to be streaming? Why not just use the MP3 files? If you encode the file at about 96kbps you can get 30 seconds of "not too bad" audio for about 350KB. I believe this is what Amazon uses for their MP3 previews. These files are small enough that they should download pretty quick even on a modern connection.

Personally, I think streaming is overrated unless you're dealing with fairly large files. I'd suggest just giving them the 30 second MP3 sample.


0

Response Number 3
Name: Palookaville
Date: December 2, 2005 at 05:18:00 Pacific
Reply:

I think the idea our tutor suggested streaming was the idea of stopping people from downloading them. I don't really know who would want to download a 30 sec sample, seems a bit pointless, but it's the principle.

I think Michael' suggestions makes more sense though, so cheers.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Audio Streaming - PHP

Streaming audio www.computing.net/answers/webdevel/streaming-audio/2349.html

streaming audio help www.computing.net/answers/webdevel/streaming-audio-help/2415.html

Slow audio streaming www.computing.net/answers/webdevel/slow-audio-streaming/2395.html