On Nov 15, 2012, at 2:02 PM, JM_SH <[email protected]> wrote:
> I have a new issue, I want to reproduce an audio file (mp3)...
...
> The audio file is in the Resources foulder.
Untested, but try the following:
1. Create a Resources\raw folder
2. Place your mp3 into the Resources\raw folder; set its Build action to
AndroidResource.
3. Use MediaPlayer.Create() [0] to create the MediaPlayer:
MediaPlayer player = MediaPlayer.Create (this,
Resource.Raw.YourAudioFile);
player.Prepare ();
player.Start ();
See also the Working With Audio sample, though that uses files and not
resources:
https://github.com/xamarin/monodroid-samples/tree/master/Example_WorkingWithAudio
https://github.com/xamarin/monodroid-samples/blob/master/Example_WorkingWithAudio/Example_WorkingWithAudio/PlayAudio.cs
- Jon
[0]:
http://androidapi.xamarin.com/index.aspx?link=M%3aAndroid.Media.MediaPlayer.Create(Android.Content.Context%2cSystem.Int32)
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid