Code example for AudioManager

Methods: getProperty

0
			boolean lowLatency = pm.hasSystemFeature(PackageManager.FEATURE_AUDIO_LOW_LATENCY);
			AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
			int sr = 44100;
			int bs = 512;
			try { 
				sr = Integer.parseInt(am.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE));
				bs = Integer.parseInt(am.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER));
				Log.i(TAG, "sample rate: " + sr + ", buffer size: " + bs);
			} catch (Exception e) {
				Log.e(TAG, "Missing or malformed audio property: " + e.toString());
			} 
			return new JellyBeanMR1OpenSLParameters(sr, 512, 512, bs, lowLatency);
		} 
	} 
}