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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? socketaudioplayer.java

?? 使用Exlipse編寫的一個(gè)語音程序
?? JAVA
字號(hào):
/** * Copyright 2001 Sun Microsystems, Inc. *  * See the file "license.terms" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL  * WARRANTIES. */import com.sun.speech.freetts.audio.AudioPlayer;import com.sun.speech.freetts.util.Utilities;import java.io.DataOutputStream;import java.io.IOException;import java.net.Socket;import javax.sound.sampled.AudioFormat;/** * Implements the AudioPlayer for the freetts Client/Server demo. * This SocketAudioPlayer basically sends synthesized wave bytes to the * client. */public class SocketAudioPlayer implements AudioPlayer {    private AudioFormat audioFormat;    private Socket socket;    private DataOutputStream dataOutputStream;    private boolean debug = false;    private int bytesToPlay = 0;    private int bytesPlayed = 0;    private boolean firstByteSent = false;    private long firstByteTime = -1;    /**     * Constructs a SocketAudioPlayer that will send wave bytes to the     * given Socket.     *     * @param socket the Socket to which synthesized wave bytes will be sent     */    public SocketAudioPlayer(Socket socket) {	this.socket = socket;	try {	    this.dataOutputStream = new DataOutputStream		(socket.getOutputStream());            debug = Utilities.getBoolean("debug");	} catch (IOException ioe) {	    ioe.printStackTrace();	}    }    /**     * Sets the audio format to use for the next set of outputs. Since     * an audio player can be shared by a number of voices, and since     * voices can have different AudioFormats (sample rates for     * example), it is necessary to allow clients to dynamically set     * the audio format for the player.     *     * @param format the audio format     */    public void setAudioFormat(AudioFormat format) {	this.audioFormat = format;    }    /**     * Retrieves the audio format for this player     *     * @return the current audio format     *     */    public AudioFormat getAudioFormat() {	return this.audioFormat;    }    /**     * Pauses all audio output on this player. Play can be resumed     * with a call to resume. Not implemented in this Player.     */    public void pause() {}    /**     * Resumes audio output on this player. Not implemented in this Player.     */    public void resume() {}    /**     * Prepares for another batch of output. Larger groups of output     * (such as all output associated with a single FreeTTSSpeakable)     * should be grouped between a reset/drain pair.     */    public void reset() {}    /**     * Flushes all the audio data to the Socket.     *     * @return <code>true</code> all the time     */    public boolean drain() {	try {	    dataOutputStream.flush();	} catch (IOException ioe) {	    ioe.printStackTrace();	}	return true;    }    /**     *  Starts the output of a set of data. Audio data for a single     *  utterance should be grouped between begin/end pairs.     *     * @param size the size of data in bytes to be output before     *    <code>end</code> is called.     */    public void begin(int size) {	try {	    bytesToPlay = size;	    firstByteSent = false;	    dataOutputStream.writeBytes(String.valueOf(size) + "\n");	    dataOutputStream.flush();	    if (debug) {		System.out.println("begin: " + size);	    }	} catch (IOException ioe) {	    ioe.printStackTrace();	}    }    /**     * Starts the first sample timer (none in this player)     */    public void startFirstSampleTimer() {    }    /**     *  Signals the end of a set of data. Audio data for a single      *  utterance should be groupd between <code> begin/end </code> pairs.     *     *  @return <code>true</code> if the audio was output properly,      *          <code> false</code> if the output was cancelled      *          or interrupted.     *     */    public boolean end() {	if (debug) {	    System.out.println("end");	}	if (bytesPlayed < bytesToPlay) {	    int bytesNotPlayed = bytesToPlay - bytesPlayed;	    write(new byte[bytesNotPlayed], 0, bytesNotPlayed);	}	bytesToPlay = 0;	bytesPlayed = 0;	return true;    }            /**     * Cancels all queued output. All 'write' calls until the next     * reset will return false. Not implemented in this Player.     *     */    public void cancel() {}        /**     * Waits for all audio playback to stop, and closes this AudioPlayer.     * Not implemented in this Player.     */    public void close() {}    /**     * Returns the current volume. The volume is specified as a number     * between 0.0 and 1.0, where 1.0 is the maximum volume and 0.0 is     * the minimum volume. Not implemented in this Player.     *     * @return the current volume (between 0 and 1)     */    public float getVolume() {	return -1;    }    /**     * Sets the current volume. The volume is specified as a number     * between 0.0 and 1.0, where 1.0 is the maximum volume and 0.0 is     * the minimum volume. Not implemented in this Player.     *     * @param volume the new volume (between 0 and 1)     */    public void setVolume(float volume) {}    /**     * Gets the amount of audio played since the last resetTime.     * Not implemented in this Player.     *     * @returns the amount of audio in milliseconds     */    public long getTime() {	return -1;    }    /**     * Resets the audio clock. Not implemented in this Player.     */    public void resetTime() {}        /**     * Writes the given bytes to the audio stream     *     * @param audioData audio data to write to the device     *     * @return <code>true</code> of the write completed successfully,      *          <code> false </code>if the write was cancelled.     */    public boolean write(byte[] audioData) {	return write(audioData, 0, audioData.length);    }    /**     * Writes the given bytes to the audio stream     *     * @param audioData audio data to write to the device     * @param offset the offset into the buffer     * @param size the number of bytes to write.     *     * @return <code>true</code> of the write completed successfully,      *          <code> false </code>if the write was cancelled.     */    public boolean write(byte[] audioData, int offset, int size) {	try {	    if (!firstByteSent) {		firstByteTime = System.currentTimeMillis();		firstByteSent = true;	    }	    	    bytesPlayed += size;	    dataOutputStream.write(audioData, offset, size);	    dataOutputStream.flush();	    if (debug) {		System.out.println("sent " + size + " bytes " +				   audioData[0] + " " + audioData[size/2]);	    }	    return true;	} catch (IOException ioe) {	    ioe.printStackTrace();	    return false;	}    }    /**     * Shows metrics for this audio player. Not implemented in this Player.     */    public void showMetrics() {}        /**     * Returns the first byte sent time in milliseconds, the last time it     * was recorded.     *     * @return the last first byte sent time in milliseconds     */    public long getFirstByteSentTime() {	return firstByteTime;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品免费观看| 亚洲综合另类小说| 国产老肥熟一区二区三区| 精品国产欧美一区二区| 狠狠色综合播放一区二区| 久久色.com| 成人精品视频一区二区三区尤物| 中文字幕不卡在线| 91论坛在线播放| 亚洲图片自拍偷拍| 日韩欧美一区二区视频| 国产福利一区二区三区视频在线 | 日韩免费视频一区二区| 毛片一区二区三区| 国产欧美精品区一区二区三区 | 精品99久久久久久| 成人精品视频一区二区三区| 一区二区三区不卡视频在线观看| 欧美日韩国产高清一区二区 | 99久久精品99国产精品| 亚洲一区二区三区视频在线播放 | 丁香婷婷深情五月亚洲| 一区二区三区四区蜜桃| 91精品国产免费久久综合| 国产不卡在线播放| 亚洲成人第一页| 国产亚洲短视频| 欧美日韩国产综合视频在线观看| 国产精品综合久久| 亚洲成年人影院| 日本一区二区久久| 欧美精品一级二级| 不卡视频在线观看| 青青草国产精品97视觉盛宴 | 欧美在线观看一区二区| 久草热8精品视频在线观看| 亚洲欧洲国产专区| 精品乱码亚洲一区二区不卡| 95精品视频在线| 九色综合国产一区二区三区| 亚洲激情中文1区| 国产精品午夜免费| 欧美大片国产精品| 欧美午夜不卡在线观看免费| 国产精品亚洲专一区二区三区| 亚洲最新视频在线观看| 国产欧美日韩在线| 日韩精品一区二区三区swag| 91精品福利视频| 国产夫妻精品视频| 精品伊人久久久久7777人| 亚洲福利一二三区| 中文字幕佐山爱一区二区免费| 精品国产一区二区三区av性色| 欧美日韩免费一区二区三区| 99视频一区二区三区| 国产一区二区剧情av在线| 日韩在线卡一卡二| 亚洲第一搞黄网站| 一区二区理论电影在线观看| 最新不卡av在线| 国产女同互慰高潮91漫画| 精品黑人一区二区三区久久| 91麻豆精品国产无毒不卡在线观看| 91在线视频免费观看| 成人免费不卡视频| 成人国产精品免费网站| 国产高清精品网站| 成人性生交大片免费看中文| 夫妻av一区二区| 岛国av在线一区| 国产成人av电影在线观看| 国产精品乡下勾搭老头1| 国产精品影视在线| 精品一区二区av| 激情久久五月天| 韩国午夜理伦三级不卡影院| 激情综合网av| 国产资源在线一区| 国产不卡在线视频| 99久久久国产精品| 91网站黄www| 在线看国产一区二区| 日本高清成人免费播放| 欧洲精品中文字幕| 91精品国产91久久久久久一区二区| 欧美日韩精品一区二区天天拍小说 | 欧美激情一区不卡| 欧美国产激情二区三区 | 欧美性极品少妇| 欧美日韩精品一区二区三区四区 | 欧美疯狂做受xxxx富婆| 91精品国产色综合久久| 精品理论电影在线| 亚洲国产精品v| 亚洲精品水蜜桃| 午夜精品久久久久久久久| 蜜桃视频一区二区| www.av精品| 欧美色欧美亚洲另类二区| 在线电影院国产精品| 亚洲精品在线电影| 亚洲欧洲精品天堂一级| 日韩精品一二三四| 国产激情视频一区二区在线观看| 99久久免费精品| 91精品国产一区二区| 国产欧美一区二区精品性| 亚洲综合网站在线观看| 精品一区二区成人精品| 色综合一个色综合亚洲| 国产精品系列在线| 一区二区成人在线视频| 精品亚洲国产成人av制服丝袜| 成人av电影在线网| 91精品国产一区二区三区| 国产精品福利一区二区三区| 日韩制服丝袜av| av在线不卡免费看| 欧美一区二区三区播放老司机| 国产精品久久久久影视| 日韩1区2区日韩1区2区| 9人人澡人人爽人人精品| 7777精品伊人久久久大香线蕉的 | 色综合久久天天| 日韩视频免费直播| 亚洲欧洲www| 久久成人av少妇免费| 91成人看片片| 国产精品久久久久影院亚瑟 | 制服.丝袜.亚洲.另类.中文| 久久久久久99精品| 日本不卡视频一二三区| 色就色 综合激情| 久久蜜桃一区二区| 日本不卡视频在线| 欧美日韩在线直播| 中文字幕一区在线| 国产精品自产自拍| 欧美不卡123| 图片区小说区国产精品视频| av电影一区二区| 欧美国产禁国产网站cc| 国产美女久久久久| 欧美一区二区视频在线观看2020 | 日韩欧美在线一区二区三区| 亚洲国产欧美一区二区三区丁香婷| 成人精品视频.| 国产欧美一区二区在线| 久久成人久久鬼色| 日韩免费高清视频| 同产精品九九九| 欧美日韩精品免费观看视频| 亚洲精品久久久久久国产精华液| 春色校园综合激情亚洲| 国产无人区一区二区三区| 国产一区二区三区| 久久久精品中文字幕麻豆发布| 日韩av电影免费观看高清完整版| 欧美视频在线一区二区三区| 亚洲精品成人在线| 色美美综合视频| 亚洲激情中文1区| 在线观看91视频| 亚洲成人激情综合网| 欧美日韩精品一区二区三区四区| 亚洲一区二区三区爽爽爽爽爽| 在线观看亚洲一区| 亚洲高清免费在线| 欧美精品99久久久**| 捆绑变态av一区二区三区| 欧美mv和日韩mv的网站| 国产在线精品不卡| 中文字幕精品一区二区三区精品| 国产东北露脸精品视频| 中文一区二区完整视频在线观看| 99精品在线观看视频| 亚洲黄色av一区| 777精品伊人久久久久大香线蕉| 日本vs亚洲vs韩国一区三区| 日韩欧美一区电影| 国产成人精品免费看| 亚洲免费观看在线视频| 欧美性猛交xxxxxx富婆| 美女网站视频久久| 久久久噜噜噜久噜久久综合| av电影在线观看不卡| 亚洲国产精品尤物yw在线观看| 91精品国产综合久久久久久漫画 | 国产精品国产三级国产aⅴ中文| 99re66热这里只有精品3直播 | 色偷偷久久人人79超碰人人澡 | 亚洲精品视频自拍| 欧美日韩国产高清一区二区三区| 久久国产综合精品| 国产精品美女一区二区| 欧美日韩国产一级片| 国产一区二区三区四| 一区二区三区在线免费播放| 欧美一级夜夜爽|