Code example for AudioTrack

Methods: playsetStereoVolumewrite

0
			System.err.println("error, buffer empty");
			return; 
		} 
		ir = new AudioTrack(AudioManager.STREAM_MUSIC, 48000,
				AudioFormat.CHANNEL_CONFIGURATION_STEREO,
				AudioFormat.ENCODING_PCM_8BIT, bufSize, AudioTrack.MODE_STATIC);
 
		if (bufSize < buffer.length)
			bufSize = buffer.length;
 
		ir.write(buffer, 0, buffer.length);
 
		ir.setStereoVolume(1, 1);
 
		ir.play();
		System.out.println(command + " sent successfully!");
 
	} 
 
	public void buttons() { 
Contextual code suggestions in your IDE  Get Codota for Java