Code example for AudioTrack

Methods: playwrite

0
								(channels == 2)
									? AudioFormat.CHANNEL_CONFIGURATION_STEREO
									: AudioFormat.CHANNEL_CONFIGURATION_MONO,
								AudioFormat.ENCODING_PCM_16BIT)
						: VentriloInterface.pcmlengthforrate(rate) * channels * 2);
			audiotrack.play();
		} 
		audiotrack.write(sample, 0, length);
	} 
 
	public static void setVolume(final float volume) {
		for (AudioTrack audiotrack : audiotracks.values()) {
			audiotrack.setStereoVolume(volume, volume);
		} 
	} 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE