Hello everyone.
I'm experiencing some sort of problem. Let's say I have a MediaPlayer
object wich can play an audio sound and a Resources object:
Code:
resources = new Resources(this.getAssets(), new DisplayMetrics(), new
Configuration());
mp1 = MediaPlayer.create(this, R.raw.sound1);
So when I invoke mp1.start() , sound1 plays, everything's normal.
But when I try to change the sound that my MediaPlayer should play, it
doesn't work, here is what I do:
mp1.reset(); //=>So mp1 is in the Idle state
mp1.setDataSource(resources.openRawResourceFd
(R.raw.sound2).getFileDescriptor()); //State : Initialized
mp1.prepare(); //State : Prepared
mp1.start(); //Doesn't work here!!
I'm pretty sure someone can see a mistake in my code.
Tank you for your help.
Moons
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---