how to stream the audio and play that audio
i want to play mp3 file which is streamed mp3 file. i tried below link example
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/ but the bellow error is coming
02-04 20:22:48.960: ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an error or info PVMFErrResource
02-04 20:22:48.970: ERROR/MediaPlayer(425): error (1, -17)
02-04 20:22:48.989: WARN/PlayerDriver(31): PVMFInfoErrorHandlingComplete
02-04 20:22:49.089: DEBUG/dalvikvm(425): GC freed 4622 objects / 982864 bytes in 120ms
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): Error updating to newly loaded content.
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): java.io.IOException: Prepare failed.: status=0x1
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at android.media.MediaPlayer.prepare(Native Method)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.Boodang.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:210)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.Boodang.StreamingMediaPlayer.transferBufferToMediaPlayer(StreamingMediaPlayer.java:239)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.Boodang.S开发者_如何学JAVAtreamingMediaPlayer.access$3(StreamingMediaPlayer.java:219)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.Boodang.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:160)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at android.os.Handler.handleCallback(Handler.java:587)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at android.os.Handler.dispatchMessage(Handler.java:92)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at android.os.Looper.loop(Looper.java:123)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at java.lang.reflect.Method.invoke(Method.java:521)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): at dalvik.system.NativeStart.main(Native Method)
so please tell me what i will do and i hope there is better way to do this one . so please tell me how to stream the mp3 file and play the mp3 file.
Thank you.
Best Regards.
First, that blog post is nearly three years old. Never use Android blog posts from that long ago.
Second, at least through Android 2.2, streaming MP3 files was not supported over RTSP. I think it works over HTTP.
Beyond that, make sure the URL you are using actually is reachable from your device or emulator. For example, you need the INTERNET
permission in your app, your emulator needs to have Internet access, etc.
In the future, you might consider supplying source code, as a stack trace alone is usually insufficient to get assistance from anyone.
精彩评论