Question

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

Was it helpful?

Solution 2

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top