title: Android MediaPlayer - how to play in the STREAM_ALARM?
body: <p>I've tried settings the audio stream of the media player in my application using the following code but when I do this I hear no sound in the emulator. If I don't set the stream for the player then the audio plays fine. I'm sure I'm using this wrong but cannot workout how, any help?</p>
  
  <pre><code>MediaPlayer player = MediaPlayer.create(getApplicationContext(), R.raw.test_audio);
  
  AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
  audioManager.getStreamVolume(AudioManager.STREAM_ALARM);
  audioManager.setStreamVolume(AudioManager.STREAM_ALARM, audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM), AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
  player.setAudioStreamType(AudioManager.STREAM_ALARM);
  player.start();
  </code></pre>
  
  <p>Note: I've added the MODIFY_AUDIO_SETTINGS permission to my manifest already.</p>
  
  <p>Thanks!</p>