Steeler wrote:
> And I also
> can't find a way to use setDataSource() with a raw resource. 

To reset playback on a raw resource, call prepare() or prepareAsync().
Also, call seekTo(0) to reposition the playback at the beginning.

http://github.com/commonsguy/cw-advandroid/tree/master/Media/Audio/

> So after trying a whole lot of different ways (why is there no
> getState() method for MediaPlayers? That would make dealing with the
> awful state system a little better, at least), I was about to give up,
> but I decided to try one more thing. So now I'm using just one
> MediaPlayer for both tracks, and doing:
> 
> musicLoop.pause();
> musicLoop = MediaPlayer.create(_context, R.raw.loop);
> musicLoop.start();

It will be more efficient to call stop(), prepare(), and seekTo(0),
followed by start().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 26-30 April 2010: http://onlc.com

-- 
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

Reply via email to