Code example for AudioManager

Methods: getStreamMaxVolumegetStreamVolume

0
		} 
	} 
 
	public int play(int id) {
		if (!Build.DEVICE.equals("GT-S5830B") && !Build.DEVICE.equals("GT-I9100")) {
			float streamVolume = manager.getStreamVolume(AudioManager.STREAM_MUSIC);
			streamVolume /= manager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
			streamVolume *= globalVolume;
			return pool.play(samples.get(id), streamVolume, streamVolume, 1, 0, 1.0f);
		} 
		return -1; 
	} 
 
	public void stop(int streamId) {
		pool.pause(streamId);
	} 
 
	public void setGlobalVolume(float volume) {
		globalVolume = volume;
	}