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,
					(rate == 48000)
						? AudioTrack.getMinBufferSize(
								48000, 
								(channels == 2)
									? AudioFormat.CHANNEL_CONFIGURATION_STEREO
									: AudioFormat.CHANNEL_CONFIGURATION_MONO,
Experience pair programming with AI  Get Codota for Java