It is (you'd want to store the original in a non-lossy format--WAV or something like that) but re-encoding on the fly's a rather CPU-intensive thing. Try, for chuckles, ripping a track off a CD to a WAV file. Encode it as an MP3 and note both how long it takes and how much CPU power it takes.
If you've only a few different bitrates that you're going to provide the track at, you may find it better to pre-encode the music. If you're not going to do that, you'd be well-served to cache the various bitrate formats of the MP3s, so you only need to encode them once, disk space generally being much cheaper than CPU time. | [reply] |
I would have thought that the server could convert from from CD to mp3 faster than the cleint could download it and i thought that there would be some perl functionality on this considering its a web based application.
| [reply] |
Sure, the conversion rate for one client connection would probably outstrip download times. If you have only one client at once, and do nothing else on the server, then it's doable. But... do you really expect only a single client will ever connect at one time, and does the box do nothing else while the connection's in play?
Most boxes do other things, and potentially repeatedly converting the same track over and over again is a waste of time which could be used by other processes. And if you've got the potential for multiple connections simultaneously, it doesn't take that long before you'll find that either the conversion CPU requirements or the disk I/O for the (large) raw data is the bottleneck.
| [reply] |