Stream a very large mp3?

by g1bb » Thu, 12 Mar 2009 09:00:14 GMT


Sponsored Links
 Hello,

Is it possible to stream a very large mp3 using MediaPlayer? The mp3 I
am interested in is over 270 mb.

Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~



Stream a very large mp3?

by g1bb » Thu, 12 Mar 2009 09:25:29 GMT


 For the record, here is the code:

 MediaPlayer player = new MediaPlayer();

            player.setAudioStreamType(AudioManager.STREAM_MUSIC);

            try {

                player.setDataSource(" http://mybigmp3.mp3 ");
                        } catch (IllegalArgumentException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        } catch (IllegalStateException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        } catch (IOException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
            try {
                                player.prepare();
                        } catch (IllegalStateException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
            player.start();


And the logcat:
03-12 01:22:10.996: WARN/System.err(324): java.io.IOException: Prepare
failed.: status=0xFFFFFFF6
03-12 01:22:10.996: WARN/System.err(324):     at
android.media.MediaPlayer.prepare(Native Method)
03-12 01:22:10.996: WARN/System.err(324):     at
com.myapp.app.Main.onCreate(Main.java:35)
03-12 01:22:10.996: WARN/System.err(324):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1122)
03-12 01:22:10.996: WARN/System.err(324):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2104)
03-12 01:22:10.996: WARN/System.err(324):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2157)
03-12 01:22:10.996: WARN/System.err(324):     at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
03-12 01:22:10.996: WARN/System.err(324):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)
03-12 01:22:10.996: WARN/System.err(324):     at
android.os.Handler.dispatchMessage(Handler.java:88)
03-12 01:22:10.996: WARN/System.err(324):     at android.os.Looper.loop
(Looper.java:123)
03-12 01:22:11.006: WARN/System.err(324):     at
android.app.ActivityThread.main(ActivityThread.java:3739)
03-12 01:22:11.006: WARN/System.err(324):     at
java.lang.reflect.Method.invokeNative(Native Method)
03-12 01:22:11.006: WARN/System.err(324):     at
java.lang.reflect.Method.invoke(Method.java:515)
03-12 01:22:11.006: WARN/System.err(324):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
03-12 01:22:11.006: WARN/System.err(324):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
03-12 01:22:11.006: WARN/System.err(324):     at
dalvik.system.NativeStart.main(Native Method)
03-12 01:22:11.006: ERROR/MediaPlayer(324): start called in state 0
03-12 01:22:11.026: ERROR/MediaPlayer(324): Error (-38,0)




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Stream a very large mp3?

by Dave Sparks » Thu, 12 Mar 2009 10:44:29 GMT


 've never tried an MP3 that big - it's quite possible that it won't
work. I think the largest file we ever tested was a one hour MP3 mix
file. I think it was about 70 MB.

On Mar 11, 6:25 pm, g1bb <corymgibb...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to install zxing on android 2.0

hi..

i am trying to install zxing on android 2.0 emulator but i am getting
an "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE" error.

i know why this error occurs -- please refer the post below

2. External strings.xml?

Hi,

Is it possible to have an external strings.xml or something like that?
I'd like to translate my application into several different languages,
but the apk would become to large if I include all languages. I would
instead like to be able to load languages on demand (from an external
url) and store them on the sdcard.

Is that possible in any way? How could I in that case use the new
language?

Kaj

-- 

3. Programmatically turning off the screen and locking the phone

4. How can we know if Android is currently locked or not ?

5. Broadcasts - ACTION_MEDIA_SCANNER_STARTED - ACTION_MEDIA_SCANNER_FINISHED

6. Traceview, OutOfMemoryError - How to make it work "again"

7. How to have TimerTask (or equivalent) that executes even while display is sleeping ?