简体   繁体   中英

streaming audio by samples from server in a local network

Excuse me, if my question is silly, but I'm a beginner at web-developing. I am trying to write codes with php and javascript and can't find an answer or some example how to solve my problem.

The problem is to send audio samples (not a file) from server to client and to play this audio on client.

I will be very grateful for any help.

There are several ways to play audio in browser:

1) Most usual flash-plugin:

With flash you can handle raw PCM samples and play them but in that case you need at least basic knowledge of flash API's and ActionScript 3.

2) HTML5 Video/Audio API's (Javascript), but specifications for these are not finished yet:

With current API's you cannot handle PCM directly without media container. Google for containers currently supported by browsers, different browsers support different containers and different codecs.

3) Other plugins like Windows Media Player:

Maybe you will find, plugin suitable for you but take in account, if you plan to stream your sound to large audience then you better go with popular plugin like flash.

Summary:

Sending PCM samples over network is much slower then compressed audio, but as far as you are in local network this should not be a problem.

One solution is, wrap your samples on server(with PHP), you should choose media container accordingly to client side you choose.

Or learn little bit of flash and make flash swf that can play PCM samples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM