Code example for AudioManager

Methods: getRingerModegetStreamMaxVolumegetStreamVolume

0
	} 
	 
	private void playSound(int soundID) {
		// If the ring mode is set to silent or vibrate, the user probably doesn't 
		// want the cat to make any noise 
		if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL)
			return; 
		 
    	float streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
		streamVolume = streamVolume / mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
    	mSoundPool.play(soundID, streamVolume, streamVolume, 1, 0, 1f);  		
	} 
	 
	private void miniPurr() { 
		playSound(miniPurrID);
	} 
	 
	private void purr() { 
		long[] pattern = { 30, 400, 30, 400, 30, 400, 30, 400, 30, 400,
						   30, 400, 30, 400, 30, 400, 30, 400, 30, 400, 
						   30, 400, 30, 400, 30, 400, 30, 400, 30, 400,