Code example for LinkedBlockingQueue

Methods: add

0
		private int readBlock() { 
			short[] buf = new short[this.block_size];
			int nshorts = mAudioRecord.read(buf, 0, buf.length);
			if (nshorts > 0) {
				Log.i("Posting " + nshorts + " samples to queue");
				mQueue.add(buf);
			} 
			return nshorts;
		} 
	} 
 
	/** 
	 * PocketSphinx native decoder object. 
	 */ 
	Decoder mDecoder;
	/** 
	 * Audio recording task. 
	 */ 
	AudioTask mAudioTask;
	/** 
	 * Thread associated with recording task.