do you mean like this
    MediaPlayer mp = MediaPlayer.create(this, R.raw.song2);
    mp.start();
when I do that the song stops/ does not start ?

On Thu, Mar 17, 2011 at 6:35 PM, Mark Murphy <mmur...@commonsware.com>wrote:

> On Thu, Mar 17, 2011 at 6:24 PM, brian purgert <brianpurge...@gmail.com>
> wrote:
> > http://developer.android.com/guide/topics/media/index.html
> >
> >  MediaPlayer mp = new MediaPlayer();
> >
> >     mp.setDataSource(PATH_TO_FILE);
> >
> >     mp.prepare();
> >
> >     mp.start();
> >
> > I have a file in my res/raw folder called song2 and I don't know what to
> put
> > for PATH_TO_FILE
>
> You don't do it that way. Use the static create() method on
> MediaPlayer and pass in R.raw.song2.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training in Oslo: http://bit.ly/fjBo24
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to