|
|
Subject:
Live Streaming Audio Data (w/ a Twist!)
Category: Computers Asked by: russelh-ga List Price: $30.00 |
Posted:
30 Jul 2004 14:15 PDT
Expires: 29 Aug 2004 14:15 PDT Question ID: 381466 |
I am currently trying to set up a system using RealProducer and HelixServer to deliver live streaming audio data (however, I am willing to change to something else). The audio data that I am trying to stream is coming across a network, and into the server's NIC in packet format. I want to deliver it through RealPlayer any time someone connects to the site that the media is to be hosted on. The idea is for someone to navigate to the site, and click on a "sensor" where they will then be able to hear acoustic data that is being transmitted across a network. My problem arises because the audio data needs to be streaming LIVE, but it is not coming through a sound card. It is data coming across a network, and not through a microphone, or the like. I have conferred with my colleagues about how to do this and we have come up with some ideas, but no solutions. First, we thought to write our own WAV file which would then be handed to RealProducer to be encoded, and then off to Helix Server to be delivered. This would of course have to be a FIFO file, since the data never really stops being written to the file. However, in the WAV file structure (as I am sure you know) when you get to the data chunk, you must specify a size. This is where I am stumped because there is no size... it is live streaming data. Second, we thought to try and direct the data through the sound card... this seemed infeasible because the amount of data coming across is ridiculous, and directing it through the sound card seems like too many levels of indirection. However, we are willing to hear arguments for why this is a good option, if you have any. :) Finally, we thought of writing our own little virtual device (not sure if that?s been done) and writing the correct IOCTL calls for RealProducer to think that it is talking with a real device. Again, we hit trouble because we don?t have a clue how RealProducer interacts with live devices. We would definitely need some help, if that were to be our only option. My question to you is, how can we get the audio data coming to us from across a network into the correct format for RealProducer to encode and hand to Helix Server? I am certainly willing to change up the configuration of RealProducer and Helix Server, and I am open to any suggestions that you could offer regarding this matter. We would greatly appreciate any help. Thank you! | |
| |
| |
| |
| |
|
|
Subject:
Re: Live Streaming Audio Data (w/ a Twist!)
Answered By: maniac-ga on 02 Aug 2004 18:04 PDT Rated: |
Hello Russelh, OK. 44100 samples per second at 16 bit; nice standard values. You don't mention if its big or little endian (e.g., AIFF vs. WAV), but most of the tools with either detect that automatically or can be configured the right way. I will also assume you can either: #1 take the network packets and output them to standard output. For an example, see http://rawrec.sourceforge.net/ which can read / write audio data in this way. You could take the source code of this and adapt it to your network packets if needed. #2 take the network packets and have them appear in a named pipe or some other method to have it show up in your file system. For example: http://www.linuxjournal.com/article.php?sid=2156 describes how you can set up named pipes (and how they work) on Linux. If one of these is NOT true, please let me know with a clarification request so I can make some additional suggestions. I also assume you do not want to encode speech audio - there are better tools such as http://www.speex.org/ which handle that as well. There are several different encoding methods available. For example: - MP3 - an extremely popular format, a good general description is at http://en.wikipedia.org/wiki/MP3 A long and detailed FAQ is at http://mail.phys-iasi.ro/Library/Computing/mpeg_layer_3.htm Note that you may require a license to use for a commercial purpose. See http://www.mp3licensing.com/help/developer.html for the FAQ on licensing terms. The per unit license fees are quite small, but if you sell the streamed data for a fee, you may be subject to a fee for that. - Ogg Vorbis - a completely free audio format described at http://www.vorbis.com/ - FLAC (Free Lossless Audio Codec) - a completely free compression / streaming format that is lossless (44100 in -> compressed data -> 44100 out at the far end). See http://flac.sourceforge.net/features.html for more information. - AAC (Advanced Audio Coding) - information available at http://www.audiocoding.com/ is the format used by Apple for iTunes and the iPod. This site has source code for encoding / decoding. You may also need licensing for this format - see http://www.vialicensing.com/products/mpeg4aac/standard.html for details. Applications that support one or more of these formats include: - libsndfile (http://www.mega-nerd.com/libsndfile/) - a general audio read / write package and able to convert between several popular formats. Used by several of the other packages. - icecast (http://www.icecast.org/) - a streaming media server supporting both MP3 and Ogg Vorbis data. Note that it can be configured to take data from directories of "music files" or to read from a live stream from an audio card or already encoded data (e.g., output from #1 above). - Gstreamer (http://gstreamer.freedesktop.org/features/) - a multimedia framework that allows you to build applications that can play audio, do editing, record audio, and so on. - LAME (http://lame.sourceforge.net/using.html) a very sparse web site, but a capable encoder of MP3 streams. Note the guide to command line options which describes how to specify the input data, can pipe the results to other applications, etc. - BladeEnc (http://bladeenc.mp3.no/) an MP3 encoder, used by several other products (see product list). Note it works OK but is not under active development. - OpenMash (http://www.openmash.org/) is another audio framework. Was actively under development due to an NSF grant, but the funding dried up and is not very active now. A pretty good set of audio server scripts in use at the DNA Lounge is at: http://www.dnalounge.com/backstage/src/icecast/ In particular, note the "ice-downcoder.pl" script which reads from an active stream and resamples it to a lower rate for broadcast. This is a good example of using LAME to convert data in pipes. A simple illustration on how you put the tools together (assuming Icecast) at http://liveice.sourceforge.net/understanding.html An extensive performance comparison (encode / decode) is at http://flac.sourceforge.net/comparison.html primarily looking at lossless algorithms. A "Dare to Compare" page with various samples of original audio and the compressed files for comparison. http://www.xiph.org/ogg/vorbis/listen.html Note it compares with a couple proprietary algorithms as well. An interesting tutorial on Linux audio streaming at: http://www.yolinux.com/TUTORIALS/LinuxTutorialAudioStreaming.html Note the long list of links to further resources on Linux audio streaming at the end. For a low / no cost solution, I suggest using - a capture application to convert your network messages to something your selected codec can use - Icecast (and plugins) for the basic streaming capability - a free format such as FLAC (lossless) or Ogg Vorbis - players with appropriate plugins for the receiving systems Good luck with your work. Don't hesitate to make a clarification request if some part of this is unclear or does not fully meet your needs. --Maniac |
russelh-ga
rated this answer:
and gave an additional tip of:
$5.00
Absolutely phenomenal researcher! I have never used this service before, but now I am hooked! :) I was researching my problem for a week, vigorously, and thought I had exhausted all of my options. Thanks to the knowledge and expertise of GA, I am well on my way to success! Thanks again! |
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |