3

I want to develop a source client for icecast server in android. I searched much on the Net, but I didn't find any correct solution and any way to do that.

If anyone has knowledge about it please reply here and I also didn't understand how to send that that metadata to the icecast server.

I viewed the links below:

@Brad Thanks for your reply, i seen lots of question and the more of them answered by you. am just waiting for your reply, thanks 1)I installed icecast server on my local machine 2)From my android program i connected to icecast server (tcp connection) 3)The code is below

s = new Socket("10.0.2.2",8000);
            Log.d("VS", "Socket Created");
            OutputStream out = s.getOutputStream();
            Log.d("VS", "Output Stream Established");
            output = new PrintWriter(out);
            Log.d("VS", "Send Header");
            output.println("SOURCE /stream ICE/1.0");
            output.println("content-type: audio/mpeg");
            output.println("Authorization: Basic c291cmNlOmhhY2ttZQ==");
            output.println("ice-name: This is my server name");
            output.println("ice-url: http://www.google.com");
            output.println("ice-genre: Rock");
            output.println("ice-bitrate: 128");
            output.println("ice-private: 0");
            output.println("ice-public: 1");
            output.println("ice-description: This is my server description");
            output.println("ice-audio-info: ice-samplerate=44100;ice-bitrate=128;ice-channels=2");
            output.println("");
            output.flush();
            Log.d("VS", "Header sent"); 
            reader = new BufferedReader(new InputStreamReader(s.getInputStream()));
            for (String line; (line = reader.readLine()) != null;)
            {
                          if (line.isEmpty()) break; 
                          Log.d("VS", "Responce From Server");
                          Log.d("VS",line);
            } 
            Log.d("VS", "Sending Password");
            output.println("pass:hackme");
            output.println("");
            output.flush();
            for (String aline; (aline = reader.readLine()) != null;)
            {
                          if (aline.isEmpty()) break;
                          Log.d("VS", "Responce From Server");
                          Log.d("VS",aline);
            }

In logcat: Socket Created, Output Stream Established, Send Header, Header sent, Responce From Server, HTTP/1.0 200 OK, Sending Password, after "Sending Password" msg there no server response.

In this link http://droidtools.sourceforge.net/content/icecast-client-android there is shown that libshout,libvorbis for android,these (library) are require for making source client in android?

I am verry new in android development.If there is any problem in code or other way to do that please let me know. Thanks

Jonas
  • 121,568
  • 97
  • 310
  • 388
Avinash Aher
  • 77
  • 2
  • 10
  • As I mentioned in the post you linked to, http://stackoverflow.com/a/9985297/362536, the metadata is updated via a simple HTTP request. Can you elaborate on what you don't understand about it? – Brad Jun 20 '13 at 14:36
  • After having connection with icecast server. How you send the data to the icecast server. Please share your research – N Sharma Oct 28 '13 at 06:35
  • @Williams For sending sound stream to server you must encode the audio to mp3 or ogg.In my project the code is totally changed,after connection i encode the sound to ogg format then send that encoded live streaming to server.Actually i used the NDK to encode the sound there is no option to encode sound in android as per my knowledge. – Avinash Aher Nov 08 '13 at 11:11

2 Answers2

1

Checkout my github project repo android-icecast-broadcast.

It is captures, encodes pcm audio from mic. and broadcasts ice server. I've included native libs but you can build them on your own.

Fatih S.
  • 341
  • 2
  • 8
-1

Yes,you need a extra library for encode the PCM data to ogg or vorbis or opus format.By using NDK.

Avinash Aher
  • 77
  • 2
  • 10