⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decoder.java

📁 Myjxta的源代码 基于JXTA的P2P即时通信系统
💻 JAVA
字号:
/* * Created on Oct 18, 2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */package net.jxta.myjxta.plugins.vojxta;import org.xiph.speex.SpeexDecoder;import java.io.StreamCorruptedException;/** * @author Ravi * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */public final class Decoder{    private final SpeexDecoder decoder;    	public static void main(String[] args) {	}	/**	 * 	 */	public Decoder() {        		super();        		decoder = new SpeexDecoder();        		decoder.init(AudioResource.MODE, AudioResource.SAMPLE_RATE, AudioResource.CHANNELS, false);	// boolean enhanced = false	}		/**	 * 	 * @param buf	 * @return speex decoded byte array	 */	public byte[] decode(byte[] buf){        		try {            			decoder.processData(buf, 0, buf.length);            		} catch (StreamCorruptedException e) {            			e.printStackTrace();            		}		byte[] decoded = new byte[decoder.getProcessedDataByteSize()];        		decoder.getProcessedData(decoded, 0);				return decoded;	}		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -