eyberg
eyberg

Reputation: 3260

How to Serve/Stream Multiple Audio Files

I'm working on a project where we have many small audio files of around 500-600k. Then there are audio files of around 15M.

The 15M files are full narrated articles. The smaller ones are individual sentences within the article.

There are going to be many users and many articles in the future.

I want to be able to load the audio files relatively fast -- either through pre-loading or streaming or something of that nature. Basically if a user clicks on a button -- I want the audio to start more or less immediately.

What are my options here? Red5? Icecast?

EDIT: I'd like to avoid flash if at all possible but not opposed to it -- I definitely can't use html5 audio as much as I'd like too.

I've already tried doing document onload to issue get requests for the files -- there are usually 15-20 per page. (19 small files, one big one). That doesn't seem to work as well as I thought it might.

In terms of latency -- I'm looking for push-button instant play -- right now I can count to 2 or 3 for the small files and 6-7 for the big one. Flash would be able to do this?

Upvotes: 1

Views: 1517

Answers (2)

eyberg
eyberg

Reputation: 3260

ok -- so i did some investigation and figured out what the competition was using

it was this:

http://www.schillmania.com/projects/soundmanager2/

basically what it does is try and use html5 audio tags with the ever so helpful 'preload=true' flag set and if it can't do that it fallsback on flash to preload the mp3

Upvotes: 1

Brad
Brad

Reputation: 163282

Streaming solutions such as Icecast are not appropriate here. All you need is simple HTTP.

You don't mention what you are playing these things on the client side with. If you are doing this in flash, it is relatively simple to preload or play while the download is still running.

For audio compression, you should be using MP3. For speech, you can easily get away with a lower bitrate. 48kbit 44.1kHz Mono is generally acceptable. This will load fine, even on decent mobile connections.

In any case, HTTP is the way to go. That way you can request the separate files easily. Icecast is for a single stream that runs for awhile, such as internet radio.

Upvotes: 1

Related Questions