Hi All,
My below code works fine on Genymotion emulator but it doesn't work while I am debugging on the device (I can't hear any voice):
`[assembly: Dependency(typeof(AudioService))]
namespace Persevy.Android
{
public class AudioService : IAudio
{
public AudioService()
{
_medialPlayer = new MediaPlayer();
}
private MediaPlayer _medialPlayer;
public bool PlayMusicFile(string fileName)
{
_medialPlayer.Reset();
_medialPlayer = MediaPlayer.Create(global::Android.App.Application.Context, Resource.Raw.ding_persevy);
_medialPlayer.Start();
return true;
}
}
}`
and
`try
{
DependencyService.Get<IAudio>().PlayMusicFile(
StaticData.PomoBreakEndMusicFile
);
}
catch (NullReferenceException ex)
{
}`
I've also added a RECORD_AUDIO
permission. What should I check else?