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 enable/disable data network

Hi,

I need to find a way to enable / disable data network, but can't find
any API for that.
For WIFI, there's a method setWifiEnabled(boolean) on the class
WifiManager.
But I can't find anything like that for the data network... no method
for this on TelephonyManager or ConnectivityManager

Any idea?
/Gal

-- 

2. dynamic broadcast receiver for connectivity changes

I'm trying to register a dynamic broadcast receiver using the
following:

BroadcastReceiver connectivityReceiver = new
ConnectivityChangeIntentReceiver(); IntentFilter connectivityFilter =
new IntentFilter();
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
filter.addAction(android.net.ConnectivityManager.CONNECTIVITY_ACTION);
myApplicationContext.registerReceiver(connectivityReceiver,
connectivityFilter);

but I see my ConnectivityChangeIntentReceiver.onReceive method is not
called when I turn off Wifi through settings or change to airplane
mode.

Has anyone faced a similar problem?

I do not want to statically register the receiver in the Manifest
file, as I don't want my app to be started by connectivity changes.

-- 

3. Make a phone call with special character *123*456789#

4. Face book Data coming null

5. TCP/IP Communication between application running on development system with application running in Android emulator

6. onActivityResult does not always get triggered when using IMAGE_CAPTURE with startActivityForResult

7. Changing LandScape to Potrait mode