0
中發送帶有音頻的標題和藝術家名稱以下代碼按照預期流向icecast服務器的方式工作。但我想發送額外的信息,如標題,藝術家和流。我曾嘗試添加冰標題,冰藝術家,標題,藝術家等標籤。但它不添加標題&藝術家如何使用icecast客戶端在android
s = new Socket(server,port_num);
Log.d("VS", "Socket Created");
out = new BufferedOutputStream(new DataOutputStream(s.getOutputStream()));
Log.d("VS", "Output Stream Established");
output = new PrintWriter(out);
Log.d("VS", "Send Header");
output.println("SOURCE /"+mountpoint+" ICE/2.0");
output.println("Authorization: Basic "+authString);
output.println("ice-name:"+title);
output.println("ice-url:echonet.cc");
output.println("TITLE="+title);
output.println("ARTIST="+generalUsername);
output.println("ice-username:"+generalUsername);
output.println("ice-user:"+generalUsername);
output.println("content-type: application/x-ogg");
output.println("User-Agent: App");
output.println("ice-private: 0");
output.println("ice-public: 1");
output.println("ice-audio-info: ice-samplerate="+sampleRate_string+"ice-quality="+quality_string+";ice-channels="+channel_string);
output.println("ice-audio-info: ice-samplerate=8000;ice-bitrate=128;ice-channels=2");
output.println("\r\n");
output.println("\n");
output.flush();
Log.d("VS", "Header sent");
reader = new BufferedReader(new InputStreamReader(s.getInputStream()));
for (String line; (line = reader.readLine()) != null;) {
if (line.equals("")) break;
Log.d("VS", "Responce From Server");
Log.d("VS",line);
}
我很新到Android編程。如果在代碼或任何其他方式發送標題&藝術家有任何問題,請讓我知道。謝謝
這看起來非常非常錯誤。只需使用libshout綁定:http://stackoverflow.com/a/28192505/2648865 – TBR 2015-02-13 11:24:34