Code example for LinkedBlockingQueue

Methods: add

0
		int readBlock() { 
			short[] buf = new short[this.block_size];
			int nshorts = this.rec.read(buf, 0, buf.length);
			if (nshorts > 0) {
				Log.d(getClass().getName(), "Posting " + nshorts + " samples to queue");
				this.q.add(buf);
			} 
			return nshorts;
		} 
	} 
 
	/** 
	 * PocketSphinx native decoder object. 
	 */ 
	Decoder ps;
	/** 
	 * Audio recording task. 
	 */ 
	AudioTask audio;
	/** 
	 * Thread associated with recording task.