Code example for AudioTrack

Methods: getPlaybackRate

0
	} 
 
	public static int rate(final short id) {
		AudioTrack audiotrack;
		if ((audiotrack = audiotracks.get(id)) != null) {
			return audiotrack.getPlaybackRate();
		} 
		return 0; 
	} 
 
	public static void write(final short id, final int rate, final byte channels, final byte[] sample, final int length) {
		AudioTrack audiotrack;
		if ((audiotrack = audiotracks.get(id)) == null) {
			audiotrack = open(id, rate, channels, VentriloInterface.pcmlengthforrate(rate) * channels * 2);
			audiotrack.play();
		} 
		audiotrack.write(sample, 0, length);
	} 
 
}