2016-11-26 7 views
0

私は、このストリームからオーディオをストリーミングするアンドロイドアプリを作成したいです。http://wiki.radioreference.com/images/5/58/RRaudioAPI_1.2.pdfドキュメントAPIですが、私はいくつかの経験があります。私はそのデータを見ることができました。オーディオをストリーミングする方法を見つけることができません。ストリームとして使用する.mp3ファイルはありません。ブロードキャストからのストリームオーディオandroid

答えて

0

全体をhereから取った。

mPlayer = new MediaPlayer(); 
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
try { 
    mPlayer.setDataSource(url); 
} catch (IllegalArgumentException e) { 
    Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); 
} catch (SecurityException e) { 
    Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); 
} catch (IllegalStateException e) { 
    Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); 
} catch (IOException e) { 
    e.printStackTrace(); 
} 
try { 
    mPlayer.prepare(); 
} catch (IllegalStateException e) { 
    Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); 
} catch (IOException e) { 
    Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); 
} 
mPlayer.start(); 

あなたがする必要があるすべては彼らの規則に従ってzendeskのURLを作成し、MediaPlayerのオブジェクトにそれを養うあるようなので、それが見えます。

完全なチュートリアルを読むことを強くお勧めします。

+0

私は使用すべきURLは何ですか? –

関連する問題