Howdy all, this is a problem faced by an Android Australia group
member. Since we're just starting out I've reposted here to get him a
solution. Any help would be appreciated. Kind regards, Nick.
---------- Forwarded message ----------
hey guys,
i got a bit a code in a resource utility class:
static public void playSound(Context ctx, int resId) {
try {
MediaPlayer mp = MediaPlayer.create(ctx,
resId);
mp.setOnErrorListener(mediaErrorListener);
mp.start();
} catch (Exception e) {
Log.e(LOG_TAG, "unable to play sound", e);
}
}
static public class MediaErrorListener implements
MediaPlayer.OnErrorListener {
@Override
public boolean onError(MediaPlayer mp, int what, int
extra) {
Log.e(LOG_TAG, "unable to play sound what:(" +
what + ") extra:(" +
extra + ")");
return false;
}
}
its been working fine. but i just tried it on a long instructional mp3
file (10min) & 7MB and it stops after 20sec.
any ideas?
rgds ash
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---