I'm trying to implement a PlaySound() method that should play a default Notification sound. It does work perfectly. Here's the code:
public void PlaySound()
{
MediaPlayer mediaPlayer = new MediaPlayer();
var notification = RingtoneManager.GetDefaultUri(RingtoneType.Notification);
mediaPlayer.SetDataSource(Application.Context, notification);
Ringtone r = RingtoneManager.GetRingtone(Application.Context, notification);
mediaPlayer.SetAudioStreamType(r.StreamType);
mediaPlayer.Prepare();
mediaPlayer.Start();
}
The compiler however tells me that r.StreamType is deprecated. I've looked at various locations but can't find the 'new' way to get the StreamType. Who does know?