Code example for AudioTrack

Methods: playstopwrite

0
	 
	/** 
	 * This method merely plays whatever is currently on the sound buffer. 
	 */ 
	private void playSoundBuffer(){ 
		audioTrack.play();
		audioTrack.write(soundBuffer, 0, minBufferSize);
		audioTrack.stop();
	} 
	 
	/** 
	 * This method will be run by the client to execute some meaningless debugging sounds 
	 * to check the voltage levels produced etc. 
	 */ 
	public void debug(){ 
		if(minBufferSize < SOUND_SIZE){
			Log.e(TAG, "Buffer size too small");
		} 
		short currentLeftLevel = PCM_BIT_LOW;
		short currentRightLevel = PCM_BIT_HIGH;