亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? audiotransmit.java

?? The audioTransmit class is a simple wrapper that can be programmed to take audio input from a source
?? JAVA
字號:
/* * @(#)AudioTransmit.java	1.7 01/03/13 * * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. * * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, * modify and redistribute this software in source and binary code form, * provided that i) this copyright notice and license appear on all copies of * the software; and ii) Licensee does not utilize the software in a manner * which is disparaging to Sun. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * * This software is not designed or intended for use in on-line control of * aircraft, air traffic, aircraft navigation or aircraft communications; or in * the design, construction, operation or maintenance of any nuclear * facility. Licensee represents and warrants that it will not use or * redistribute the Software for such purposes. */import java.awt.*;import javax.media.*;import javax.media.protocol.*;import javax.media.protocol.DataSource;import javax.media.format.*;import javax.media.control.TrackControl;import javax.media.control.QualityControl;import java.io.*;public class AudioTransmit {    // Input MediaLocator    // Can be a file or http or capture source    private MediaLocator locator;    private String ipAddress;    private String port;    private Processor processor = null;    private DataSink  rtptransmitter = null;    private DataSource dataOutput = null;        public AudioTransmit(MediaLocator locator,			 String ipAddress,			 String port) {		this.locator = locator;	this.ipAddress = ipAddress;	this.port = port;    }    /**     * Starts the transmission. Returns null if transmission started ok.     * Otherwise it returns a string with the reason why the setup failed.     */    public synchronized String start() {	String result;	// Create a processor for the specified media locator	// and program it to output RTP	result = createProcessor();	if (result != null)	    return result;	// Create an RTP session to transmit the output of the	// processor to the specified IP address and port no.	result = createTransmitter();	if (result != null) {	    processor.close();	    processor = null;	    return result;	}	// Start the transmission	processor.start();		return null;    }    /**     * Stops the transmission if already started     */    public void stop() {	synchronized (this) {	    if (processor != null) {		processor.stop();		processor.close();		processor = null;		rtptransmitter.close();		rtptransmitter = null;	    }	}    }    private String createProcessor() {	if (locator == null)	    return "Locator is null";	DataSource ds;	DataSource clone;	try {	    ds = Manager.createDataSource(locator);	} catch (Exception e) {	    return "Couldn't create DataSource";	}	// Try to create a processor to handle the input media locator	try {	    processor = Manager.createProcessor(ds);	} catch (NoProcessorException npe) {	    return "Couldn't create processor";	} catch (IOException ioe) {	    return "IOException creating processor";	} 	// Wait for it to configure	boolean result = waitForState(processor, Processor.Configured);	if (result == false)	    return "Couldn't configure processor";	// Get the tracks from the processor	TrackControl [] tracks = processor.getTrackControls();	// Do we have atleast one track?	if (tracks == null || tracks.length < 1)	    return "Couldn't find tracks in processor";	boolean programmed = false;      AudioFormat afmt;	// Search through the tracks for a Audio track	for (int i = 0; i < tracks.length; i++) {	    Format format = tracks[i].getFormat();	    if (  tracks[i].isEnabled() &&		  format instanceof AudioFormat &&		  !programmed) {		afmt = (AudioFormat)tracks[i].getFormat();                       AudioFormat ulawFormat =   new AudioFormat(AudioFormat.DVI_RTP);                                              // afmt.getSampleRate(),                                               // afmt.getSampleSizeInBits(),                      // afmt.getChannels());                       // 8000,4,1);            		tracks[i].setFormat (ulawFormat);		System.err.println("Audio transmitted as:");		System.err.println("  " + ulawFormat);		// Assume succesful		programmed = true;	    } else		tracks[i].setEnabled(false);	}	if (!programmed)	    return "Couldn't find Audio track";	// Set the output content descriptor to RAW_RTP       ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);       processor.setContentDescriptor(cd);	// Realize the processor. This will internally create a flow	// graph and attempt to create an output datasource for ULAW/RTP	// Audio frames.	result = waitForState(processor, Controller.Realized);	if (result == false)	    return "Couldn't realize processor";		// Get the output data source of the processor	dataOutput = processor.getDataOutput();	return null;    }    // Creates an RTP transmit data sink. This is the easiest way to create    // an RTP transmitter. The other way is to use the RTPSessionManager API.    // Using an RTP session manager gives you more control if you wish to    // fine tune your transmission and set other parameters.    private String createTransmitter() {	// Create a media locator for the RTP data sink.	// For example:	//    rtp://129.130.131.132:42050/Audio	String rtpURL = "rtp://" + ipAddress + ":" + port + "/audio";	MediaLocator outputLocator = new MediaLocator(rtpURL);	// Create a data sink, open it and start transmission. It will wait	// for the processor to start sending data. So we need to start the	// output data source of the processor. We also need to start the	// processor itself, which is done after this method returns.	try {	    rtptransmitter = Manager.createDataSink(dataOutput, outputLocator);	    rtptransmitter.open();	    rtptransmitter.start();	    dataOutput.start();	} catch (MediaException me) {	    return "Couldn't create RTP data sink";	} catch (IOException ioe) {	    return "Couldn't create RTP data sink";	}		return null;    }    /****************************************************************     * Convenience methods to handle processor's state changes.     ****************************************************************/        private Integer stateLock = new Integer(0);    private boolean failed = false;        Integer getStateLock() {	return stateLock;    }    void setFailed() {	failed = true;    }        private synchronized boolean waitForState(Processor p, int state) {	p.addControllerListener(new StateListener());	failed = false;	// Call the required method on the processor	if (state == Processor.Configured) {	    p.configure();	} else if (state == Processor.Realized) {	    p.realize();	}		// Wait until we get an event that confirms the	// success of the method, or a failure event.	// See StateListener inner class	while (p.getState() < state && !failed) {	    synchronized (getStateLock()) {		try {		    getStateLock().wait();		} catch (InterruptedException ie) {		    return false;		}	    }	}	if (failed)	    return false;	else	    return true;    }    /****************************************************************     * Inner Classes     ****************************************************************/    class StateListener implements ControllerListener {	public void controllerUpdate(ControllerEvent ce) {	    // If there was an error during configure or	    // realize, the processor will be closed	    if (ce instanceof ControllerClosedEvent)		setFailed();	    // All controller events, send a notification	    // to the waiting thread in waitForState method.	    if (ce instanceof ControllerEvent) {		synchronized (getStateLock()) {		    getStateLock().notifyAll();		}	    }	}    }    /****************************************************************     * Sample Usage for AudioTransmit class     ****************************************************************/        public static void main(String [] args) {	// We need three parameters to do the transmission	// For example,	//   java AudioTransmit file:/C:/media/test.mov  129.130.131.132 42050		if (args.length < 3) {	    System.err.println("Usage: AudioTransmit <sourceURL> <destIP> <destPort>");	    System.exit(-1);	}		// Create a Audio transmit object with the specified params.	AudioTransmit at = new AudioTransmit(new MediaLocator(args[0]),					     args[1],					     args[2]);	// Start the transmission	String result = at.start();	// result will be non-null if there was an error. The return	// value is a String describing the possible error. Print it.	if (result != null) {	    System.err.println("Error : " + result);	    System.exit(0);	}	System.err.println("Start transmission for 60 seconds...");		// Transmit for 60 seconds and then close the processor	// This is a safeguard when using a capture data source	// so that the capture device will be properly released	// before quitting.	// The right thing to do would be to have a GUI with a	// "Stop" button that would call stop on AudioTransmit	try {	    Thread.currentThread().sleep(60000);	} catch (InterruptedException ie) {	}	// Stop the transmission	at.stop();	System.err.println("...transmission ended.");		System.exit(0);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线看| 成人精品高清在线| 这里只有精品电影| 亚洲成人手机在线| 色综合久久久久网| 中文字幕精品一区二区三区精品| 国产精品久久久久四虎| 国产一区不卡视频| 久久蜜臀中文字幕| 国产东北露脸精品视频| 久久精子c满五个校花| 国产精品一色哟哟哟| 久久久久国产精品麻豆ai换脸| 另类专区欧美蜜桃臀第一页| 欧美电影免费观看高清完整版| 亚洲成人免费av| 51精品视频一区二区三区| 午夜久久久久久久久| 6080日韩午夜伦伦午夜伦| 免费在线观看视频一区| 欧美电影免费观看高清完整版在线观看| 婷婷丁香久久五月婷婷| 日韩一级二级三级精品视频| 蜜臀av性久久久久av蜜臀妖精| 91精品久久久久久蜜臀| 久久精品国产亚洲一区二区三区| 91精品国产91热久久久做人人| 香蕉成人伊视频在线观看| 91精品欧美一区二区三区综合在| 日韩电影在线免费看| 日韩视频免费观看高清完整版在线观看 | 亚洲激情图片小说视频| 91官网在线观看| 天堂在线亚洲视频| 精品国产免费一区二区三区香蕉| 三级精品在线观看| 精品福利一区二区三区免费视频| 精品影视av免费| 国产欧美一区二区精品久导航 | 久久这里只有精品6| 国产精品香蕉一区二区三区| 国产精品无圣光一区二区| 色88888久久久久久影院野外| 亚洲免费观看视频| 制服丝袜成人动漫| 国产麻豆精品久久一二三| 国产精品久久久久久久久免费丝袜| av午夜一区麻豆| 日韩综合小视频| 国产调教视频一区| 91激情在线视频| 美日韩一区二区| 国产精品久久看| 欧美精品在线观看一区二区| 国产伦精品一区二区三区免费 | 日本美女一区二区三区| 久久―日本道色综合久久| 91看片淫黄大片一级| 久久精品国产久精国产爱| 亚洲国产电影在线观看| 欧美日韩国产中文| 粉嫩13p一区二区三区| 亚洲国产wwwccc36天堂| 亚洲精品一区二区三区在线观看| hitomi一区二区三区精品| 亚洲 欧美综合在线网络| 2023国产精品| 91色在线porny| 九色porny丨国产精品| 伊人开心综合网| 国产网红主播福利一区二区| 欧美性xxxxx极品少妇| 国产成人免费在线观看| 亚洲成人av在线电影| 国产视频视频一区| 制服视频三区第一页精品| 99久久国产综合精品麻豆 | 中文字幕日韩精品一区| 日韩免费性生活视频播放| 色综合一个色综合亚洲| 国内精品久久久久影院一蜜桃| 中文字幕中文乱码欧美一区二区| 欧美日韩国产一级片| 成人国产亚洲欧美成人综合网| 亚洲成人你懂的| 亚洲天堂免费看| 久久综合狠狠综合久久激情| 欧美视频在线观看一区| 成人午夜在线播放| 国内成+人亚洲+欧美+综合在线| 一区二区三区在线免费| 国产日产欧美精品一区二区三区| 欧美日韩亚洲国产综合| 色综合中文字幕国产| 激情综合亚洲精品| 无吗不卡中文字幕| 亚洲乱码中文字幕| 国产精品系列在线| 久久久综合网站| 欧美一级艳片视频免费观看| 在线观看av一区二区| av一区二区三区| 国产91清纯白嫩初高中在线观看| 三级成人在线视频| 亚洲国产三级在线| 亚洲精品国久久99热| 国产精品久久久久久久久久久免费看| 欧美性生活影院| 色嗨嗨av一区二区三区| 成人a免费在线看| 国产福利一区二区三区视频在线 | 不卡视频免费播放| 国产成人综合在线观看| 国内外成人在线视频| 久久精工是国产品牌吗| 日韩av一二三| 日韩精品视频网| 日日夜夜精品视频免费| 午夜精品久久久久久久| 亚洲国产色一区| 亚洲国产aⅴ天堂久久| 艳妇臀荡乳欲伦亚洲一区| 亚洲色图欧美偷拍| 综合亚洲深深色噜噜狠狠网站| 久久久久久97三级| 久久精品亚洲精品国产欧美| 精品国产91久久久久久久妲己| 精品视频一区二区不卡| 欧美性生活大片视频| 欧美体内she精高潮| 欧美三级视频在线观看| 欧美日韩一区二区三区四区| 欧美性猛片aaaaaaa做受| 欧美午夜理伦三级在线观看| 在线观看日产精品| 欧美最猛黑人xxxxx猛交| 欧美在线短视频| 欧美日韩日日夜夜| 91精品视频网| 精品国产欧美一区二区| 久久精品在这里| 一区精品在线播放| 亚洲欧美日韩国产另类专区 | 综合av第一页| 樱花草国产18久久久久| 亚洲va欧美va人人爽| 日韩av一级电影| 国产在线国偷精品免费看| 国产成人精品一区二| 99久久精品国产毛片| 欧美最猛黑人xxxxx猛交| 欧美男人的天堂一二区| 欧美成人精品二区三区99精品| 精品久久一二三区| 国产精品嫩草影院av蜜臀| 亚洲欧美一区二区三区孕妇| 亚洲国产精品一区二区www在线 | 黑人精品欧美一区二区蜜桃| 国产在线一区观看| av一区二区三区| 欧美日韩一区二区不卡| 欧美成人性战久久| 国产精品久久一卡二卡| 亚洲国产成人tv| 精品一区二区三区免费毛片爱 | 亚洲国产aⅴ天堂久久| 日韩av不卡一区二区| 国产一区二区伦理| 91在线免费看| 91精品欧美一区二区三区综合在| 精品免费一区二区三区| 国产视频一区在线播放| 亚洲精品免费在线播放| 日韩成人一级大片| 成人永久免费视频| 欧美视频自拍偷拍| 久久久久国产成人精品亚洲午夜| 国产精品剧情在线亚洲| 天堂va蜜桃一区二区三区 | 日本91福利区| 国产成人午夜视频| 欧洲精品一区二区| 久久夜色精品国产欧美乱极品| 中文字幕亚洲在| 蜜桃视频在线观看一区| aaa国产一区| 91精品国产免费| 国产精品久久久久久久久动漫| 亚洲不卡av一区二区三区| 国产美女av一区二区三区| 欧美影片第一页| 久久综合九色综合97婷婷| 国产精品一区不卡| 久久精品亚洲一区二区三区浴池| 国产精品高潮久久久久无| 五月天国产精品| 成人h动漫精品| 日韩精品中文字幕一区| 亚洲欧美精品午睡沙发| 狂野欧美性猛交blacked|