Search code examples
streaminghostingmp3audio-streamingjplayer

Audio Stream from PC/Mac to Android/iPhone


Firstly, as this is essentially a multi-disciplinary question, please feel free to submit answers which only answer one part of the post - I will upvote answers which satisfy any of the questions below.

Hi, we are putting together an installation in which:

  • Audio comes in through a microphone to an FM transmitter
  • Transmitted to receiver
  • Receiver is plugged into computer's Line In
  • Audio is recorded/streamed as an .m3u stream, or recorded, and then uploaded(?)
  • Stream is accessible by scanning QR code on iPhone/Android.

I have a few questions around the subject that I was wondering if people could help with.

  1. This is kind of a minor first question, if you are able to answer the second question, but is the best way to deal with incoming audio to record it 'before' uploading it, resulting in a delay, or is it to stream it?

  2. I'm not sure of the best way to host the upload, as I suppose that it would be either an .m3u stream or some kind of progressive .mp3 that would need to be uploaded somewhere that supported this. Any advice? Is this kind of thing possible with free webhosting solutions? It would preferably be above 128kbps, too.

  3. Initially, I presumed that the easiest way to have an audio stream linked to a URL that allowed for QR code linking was to build a very simple webpage with a media player on it, so that the end user wouldn't have to download any external application, and it could be done through the Android/iPhone browsers. Is this the case? Is the easiest way of doing this with something like <video> or <audio>, or is the HTML5 support for the mobile browsers not yet good enough? What are the alternatives? Something like jPlayer looks like it would work?

Thank you for your responses, I can give any necessary technical information you may find relevant, but these are quite broad questions. We can run the stream from either OSX 10.7 or Windows 7, as we have both, so recommendations for suitable software for either platform are welcomed.

Thanks again!


EDIT: Information from jPlayer.org -

HTML5 Audio Streams

HTML5 browsers and their support for audio streams. (Note that, jPlayer's Flash fall-back for non-HTML5 browsers works with MP3 streams.)

Audio streams work on:

Firefox (OSX, Win): OGA

Safari (OSX): MP3

Mobile Safari (iOS4 iPad/iPhone/iPod): MP3

Opera (OSX, Win): OGA

Chrome (OSX, Win): MP3, OGA

IE9 (Win): MP3

No mention of iOS5 or Android, but I used my android phone to check out the jplayer 1.2 stream demo they have up on their site, and it works. Seems like this could be the answer, but I need to know a little more about hosting, and perhaps iOS5 compatibility, though I'm sure it must work going forward. Anyone?


Solution

  • I recommend going with a standard SHOUTcast/Icecast setup.

    First, you need an encoder. I recommend Edcast if you're doing this under Windows. The encoder is responsible for listening to your sound card, and encoding/compressing the raw PCM data into MP3, or whatever format(s) you need.

    Next, you need a server. Again, SHOUTcast or Icecast will work great for you. No, you typically cannot host this on any free web hosting provider. Fortunately, hosting for SHOUTcast streams is cheap, and readily available. You can also host the server yourself, if you have the necessary bandwidth. It doesn't take much CPU/RAM.

    Finally, you need a player. Your jPlayer will work just fine. For iOS, I usually just link to the playlist file and let it play. On Android, you can do a Flash player. HTML5 compatibility is there though, and jPlayer would be the way to do it.

    Also note that there is no such thing as a ".m3u stream". A .m3u file is nothing but a playlist file, that contains the URL to the streaming audio. That's all.

    For the QR code, just link to a web page URL that contains your player. That's all you have to do.

    If you have more specific questions as you go, you should post them as separate questions here.