views:

303

answers:

2

I'm no expert in audio, so if any of you folks are, I'd appreciate your insights on this.

My client has a handful of MP3 podcasts stored at a relatively high bit rate, and I'd like to be able to serve those files to her users at "different" bit rates depending on that user's credentials. (For example, if you're an authenticated user, you might get the full, unaltered stream, but if you're not, you'd get a lower-bit-rate version -- or at least a purposely tweaked lower-quality version than the original.)

Seems like there are two options: downsampling at the source and downsampling at the client. In this case, knowing of course that the source stream would arrive at the client at a high bit rate (and that there are considerations to be made about that, which I realize), I'd prefer to alter the stream at the client somehow, rather than on the server, for several reasons.

Is doing so possible with the Flash Player and ActionScript alone, at runtime (even with a third-party library), or does a scenario like this one require a server-based solution? If the latter, can Flash Media Server handle this requirement specifically? Again, I'd like to avoid using FMS if I can, since she doesn't really have the budget for it, but if that's the only option and it's really an option, I'm open to considering it.

Thanks in advance...


Note: Please don't question the sanity of the request -- I realize it might sound a bit strange, but the requirements are what they are. In that light, for purposes of answering the question, you can ignore the source and delivery path of the bits; all I'm really looking for is an explanation of whether (and ideally how) a Flash client can downsample an MP3 audio stream at runtime, irrespective of whether the audio's arriving over a network connection or being read directly from disk. Thanks much!

A: 

I'd prefer to alter the stream at the client somehow, rather than on the server, for several reasons.

Please elucidate the reasons, because resampling on the client end would normally be considered crazy: wasting bandwidth sending the higher-quality version to a user who cannot hear it, and risking a canny user ripping the higher-quality stream at it comes in through the network.

In any case the Flash Player doesn't give you the tools to process audio, only play it.

You shouldn't need FMS to process audio at the server end. You could have a server-side script that loaded the newly-uploaded podcasts and saved them back out as lower-bitrate files which could be served to lowly users via a normal web server. For Python see eg. PyMedia, py-lame; or even a shell script using lame or ffmpeg or something from the command line should be pretty easy to pull off.

bobince
That's why I added, "There are considerations to be made about that, which I realize." :) The simple reason (and it probably sounds paradoxical) is that in this case, bandwidth doesn't matter, and storage does. Creating copies of the files isn't an option; the work has to be done on the client.
Christian Nunciato
As it happens, it looks like Flash 10 does provide low-level access to the raw sound data, though; some Googling last night revealed quite a bit of information about it. I'll post back once I have a working sample; it appears it can be done after all.
Christian Nunciato
Seems very very strange, storage is extremely cheap nowadays and storing a low quality (eg. 48kbps mono) stream in addition to a “high quality” one (eg. 160kbps joint stereo) is an almost negligable amount of extra space.
bobince
Yeah, I know it seems strange -- nevertheless, it remains so. :)
Christian Nunciato
A: 

If storage is at a premium, have you looked into AAC audio? I believe Flash 9 and 10 on desktop browsers will play it. AAC in my experience takes only half of the size of the comparable MP3 (i.e. a 80kbps AAC will sound the same as a 160kbps MP3).

As for playback quality, if I recall correctly there's audio playback settings in the Publish Settings section in the Flash editor. Wether or not the playback bitrate can be changed at runtime is something I'm not sure of.

Jake