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

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

?? findsts.java

?? 使用Exlipse編寫的一個(gè)語音程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
     * Reconstruct a wave from a wave, sts, and lpc     *     * @param sampleRate the sample rate to use     * @param lpc lpc     * @param lpc_min minimum lpc value     * @param lpc_range range of lpc values     */    public Wave(int sampleRate, STS[] stsData, LPC lpc, float lpc_min,            float lpc_range) {        // set number of samples and sample rate        numSamples = 0;        for (int i = 0; i < lpc.getNumFrames(); i++) {            numSamples += stsData[i].getNumSamples();        }        samples = new short[numSamples];        this.sampleRate = sampleRate;        int start = 0;        int end;        int[] lpcResTimes = new int[lpc.getNumFrames()];        int[] lpcResSizes = new int[lpc.getNumFrames()];        short[] lpcResResidual = new short[numSamples];        int[][] lpcResFrames = new int[lpc.getNumFrames()][];        int lpcResNumChannels = lpc.getNumChannels() - 1;        // load initial data        for (int i = 0; i < lpc.getNumFrames(); i++) {            lpcResTimes[i] = (int) (lpc.getTime(i) * sampleRate);            lpcResFrames[i] = stsData[i].getFrame();            end = start + stsData[i].getNumSamples();            lpcResSizes[i] = stsData[i].getNumSamples();            start = end;        }        for (int r = 0, i = 0; i < lpc.getNumFrames(); i++) {            for (int j = 0; j < stsData[i].getNumSamples(); j++, r++) {                lpcResResidual[r] = stsData[i].getResidual(j);            }        }        float[] lpcCoefs = new float[lpcResNumChannels];        float[] outbuf = new float[lpcResNumChannels + 1];        int ci, cr;        //float pp = 0;  // the C code uses this unnecessarily (for now)        for (int r = 0, o = lpcResNumChannels, i = 0; i <                lpc.getNumFrames(); i++) {            // residual_fold is hard-coded to 1.            int pm_size_samps = lpcResSizes[i];//  * residual_fold;            // Unpack the LPC coefficients            for (int k = 0; k < lpcResNumChannels; k++) {                lpcCoefs[k] = (float)                    ((((double) lpcResFrames[i][k])/65535.0) * lpc_range)                    + lpc_min;            }            // resynthesize the signal            for (int j = 0; j < pm_size_samps; j++, r++) {                outbuf[o] = (float)                    Utility.ulawToShort(lpcResResidual[r/* /residual_fold */]);                cr = (o == 0 ? lpcResNumChannels : o-1);                for (ci = 0; ci < lpcResNumChannels; ci++) {                        outbuf[o] += lpcCoefs[ci] * outbuf[cr];                        cr = (cr == 0 ? lpcResNumChannels : cr - 1);                }                samples[r] = (short) (outbuf[o]                    /* + pp * lpcres->post_emphasis)*/); // post_emphasis = 0                // pp = outbuf[o];                o = (o == lpcResNumChannels ? 0 : o+1);            }        }    }    /**     * Compare two waves and output how close the two are.     * Useful for checking the general accuracy of find sts.     *     * <p>     * Output may not exactly match that of flite find_sts     * on Intel platforms due to discrepencies in the way that     * Intel Pentiums perform floating point computations.     * </p>     *     * @param the wave to compare this wave against     *     */    public void compare(Wave wave2) {        if (numSamples > wave2.numSamples) {            wave2.compare(this);        } else {            double r = 0;            int i = 0;            for (i = 0; i < this.numSamples; i++) {                r += (double)((float)this.samples[i] - (float)wave2.samples[i])                    *(double)((float)this.samples[i] - (float)wave2.samples[i]);            }            r /= this.numSamples;            System.out.println("a/b diff " + Double.toString(StrictMath.sqrt(r)));        }    }    /**     * Make sure that a string of characters appear next in the file     *     * @param dis DataInputStream to read in     * @param chars a String containing the ascii characters you     *          want the <code>dis</code> to contain.     *     * @return <code>true</code> if <code>chars</code> appears next     *          in <code>dis</code>, else <code>false</code>     * @throws on ill-formatted input (end of file, for example)     */    private boolean checkChars(DataInputStream dis, String chars)            throws IOException {        char[] carray = chars.toCharArray();        for (int i = 0; i < carray.length; i++) {            if ((char) dis.readByte() != carray[i]) {                return false;            }        }        return true;    }    /**     * Get the sample rate for this wave     *     * @return sample rate     */    public int getSampleRate() {        return sampleRate;    }    /**     * Get the number of samples for this wave     *     * @return number of samples     */    public int getNumSamples() {        return numSamples;    }    /* Get the sample data of this wave     *     * @return samples     */    public short[] getSamples() {        return samples;    }}/** * The sts data */class STS {    private int[] frame;    private int numSamples;    private short[] residual;    /**     * Create an empty STS     */    public STS() {    }    /**     * Create an sts with the given data     *     * @param frame frame for this sts     * @param numSamples number of samples this sts will contain     * @param residual the residual for this sts     *      */    public STS(int[] frame, int numSamples, short[] residual) {        this.frame = new int[frame.length];        System.arraycopy(frame, 0, this.frame, 0, frame.length);        this.numSamples = numSamples;        this.residual = new short[residual.length];        System.arraycopy(residual, 0, this.residual, 0, residual.length);    }    /**     * Get the number of samples associated with this sts     *     * @return the number of samples for this sts     */    public int getNumSamples() {        return numSamples;    }    /**     * Get the residual associated with this sts     *     * @return residual associated with this sts     */    public short getResidual(int i) {        return residual[i];    }    /**     * Get the frame associated with this sts     *     * @return a copy of the frame associated with this sts     */    public int[] getFrame() {        int[] f = new int[frame.length];        System.arraycopy(frame, 0, f, 0, frame.length);        return f;    }    /**     * Get an entry out of the frame     *     * @param index the index into the frame     *     * @return the entry in the frame at offset <code>index</code>     */    public int getFrameEntry(int index) {        return frame[index];    }}/** * This class is for general purpose functions such as reading and * writing from files, or converting formats of numbers. */class Utility {    /**     * Reads the next word (text separated by whitespace) from the     * given stream     *     * @param dis the input stream     *     * @return the next word     *     * @throws IOException on error     */    public static String readWord(DataInputStream dis) throws IOException {        StringBuffer sb = new StringBuffer();        char c;        // skip leading whitespace        do {            c = readChar(dis);        } while(Character.isWhitespace(c));        // read the word        do {            sb.append(c);            c = readChar(dis);        } while (!Character.isWhitespace(c));        return sb.toString();    }    /**     * Reads a single char from the stream     *     * @param dis the stream to read     * @return the next character on the stream     *     * @throws IOException if an error occurs     */    public static char readChar(DataInputStream dis) throws IOException {        return (char) dis.readByte();    }    /**     * Reads a given number of chars from the stream     *     * @param dis the stream to read     * @param num the number of chars to read     * @return a character array containing the next <code>num<code>     *          in the stream     *     * @throws IOException if an error occurs     */    public static char[] readChars(DataInputStream dis, int num)            throws IOException {        char[] carray = new char[num];        for (int i = 0; i < num; i++) {            carray[i] = readChar(dis);        }        return carray;    }    /**     * Read a float from the input stream, byte-swapping as     * necessary     *     * @param dis the inputstream     * @param isBigEndian whether or not the data being read in is in     *          big endian format.     *     * @return a floating pint value     *     * @throws IOException on error     */    public static float readFloat(DataInputStream dis, boolean isBigEndian)            throws IOException {        float val;        if (!isBigEndian) {            val =  readLittleEndianFloat(dis);        } else {            val =  dis.readFloat();        }        return val;    }    /**     * Reads the next float from the given DataInputStream,     * where the data is in little endian.     *     * @param dataStream the DataInputStream to read from     *     * @return a float     */    public static float readLittleEndianFloat(DataInputStream dataStream)            throws IOException {        return Float.intBitsToFloat(readLittleEndianInt(dataStream));    }    /**     * Read an integer from the input stream, byte-swapping as     * necessary     *     * @param dis the inputstream     * @param isBigEndian whether or not the data being read in is in     *          big endian format.     *     * @return an integer value     *     * @throws IOException on error     */    public static int readInt(DataInputStream dis, boolean isBigEndian)            throws IOException {        if (!isBigEndian) {            return readLittleEndianInt(dis);        } else {            return dis.readInt();        }    }    /**     * Reads the next little-endian integer from the given DataInputStream.     *     * @param dataStream the DataInputStream to read from     *     * @return an integer     */    public static int readLittleEndianInt(DataInputStream dataStream)            throws IOException {        int bits = 0x00000000;        for (int shift = 0; shift < 32; shift += 8) {            int byteRead = (0x000000ff & dataStream.readByte());            bits |= (byteRead << shift);        }        return bits;    }    /**     * Read a short from the input stream, byte-swapping as     * necessary     *     * @param dis the inputstream     * @param isBigEndian whether or not the data being read in is in     *          big endian format.     *     * @return an integer value     *     * @throws IOException on error     */    public static short readShort(DataInputStream dis, boolean isBigEndian)        throws IOException {        if (!isBigEndian) {            return readLittleEndianShort(dis);        } else {            return dis.readShort();        }    }    /**     * Reads the next little-endian short from the given DataInputStream.     *     * @param dataStream the DataInputStream to read from     *     * @return a short     */    public static short readLittleEndianShort(DataInputStream dis)        throws IOException {        short bits = (short)(0x0000ff & dis.readByte());        bits |= (((short)(0x0000ff & dis.readByte())) << 8);        return bits;    }    /**     * Convert a short to ulaw format     *      * @param sample the short to convert     *     * @return a short containing an unsigned 8-bit quantity     *          representing the ulaw     */    public static short shortToUlaw(short sample) {        final int[] exp_lut = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,                                   4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,                                   5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,                                   5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,                                   6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,                                   6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,                                   6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,                                   6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,                                   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};        int sign, exponent, mantissa;        short ulawbyte;        final short CLIP = 32635;        final short BIAS = 0x0084;        /* Get the sample into sign-magnitude. */        sign = (sample >> 8) & 0x80; /* set aside the sign */        if ( sign != 0 ) {            sample = (short) -sample; /* get magnitude */        }        if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */        /* Convert from 16 bit linear to ulaw. */        sample = (short) (sample + BIAS);        exponent = exp_lut[( sample >> 7 ) & 0xFF];        mantissa = ( sample >> ( exponent + 3 ) ) & 0x0F;        ulawbyte = (short)            ((~ ( sign | ( exponent << 4 ) | mantissa)) & 0x00FF);        if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */        return ulawbyte;    }    /**     * Convert a ulaw format to short     *      * @param ulawbyte a short containing an unsigned 8-but quantity     *          representing a ulaw     *     * @return the short equivalent of the ulaw     */    public static short ulawToShort(short ulawbyte) {        final int[] exp_lut = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 };        int sign, exponent, mantissa;        short sample;        ulawbyte = (short) (ulawbyte & 0x00FF);        ulawbyte = (short) (~ulawbyte);        sign = ( ulawbyte & ((short) 0x80) );        exponent = (int) ( (ulawbyte & (short) 0x00FF) >> 4 ) & 0x07;        mantissa = ulawbyte & (short) 0x0F;        sample = (short) (exp_lut[exponent] + (mantissa << (exponent + 3)));        if ( sign != 0 ) sample = (short) (-sample);        return sample;    }    /**     * Print a float type's internal bit representation in hex     *     * @param f the float to print     *     * @return a string containing the hex value of <code>f</code>     */    public static String hex(float f) {        return Integer.toHexString(Float.floatToIntBits(f));    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区在线视频| 久久精品人人做人人综合| 捆绑调教一区二区三区| 欧美国产丝袜视频| 日韩一区二区视频| 91在线观看美女| 精东粉嫩av免费一区二区三区| 一区二区三区四区五区视频在线观看| 欧美一个色资源| 色激情天天射综合网| 国产一区二区导航在线播放| 亚洲 欧美综合在线网络| 国产精品你懂的在线欣赏| 亚洲国产精品ⅴa在线观看| 欧美日韩国产高清一区二区三区| 东方欧美亚洲色图在线| 蜜桃视频免费观看一区| 一区二区三区视频在线看| 国产拍欧美日韩视频二区| 欧美一区二区女人| 在线观看亚洲精品| 99视频在线精品| 国产电影精品久久禁18| 久久成人免费电影| 日韩激情一二三区| 一区二区免费在线| 国产精品不卡一区| 欧美国产禁国产网站cc| 久久久久久久久久久久久女国产乱| 欧美日本一道本| 欧美午夜精品久久久久久孕妇| 成人app在线观看| 国产精品88av| 精品夜夜嗨av一区二区三区| 日韩av一区二区在线影视| 亚洲高清免费观看| 亚洲五码中文字幕| 一级精品视频在线观看宜春院| 亚洲色欲色欲www| 亚洲品质自拍视频| 亚洲视频每日更新| 亚洲日本电影在线| 综合久久给合久久狠狠狠97色| 精品国产99国产精品| 日韩精品一区二区三区视频 | 日韩一区二区三区免费看 | 欧美中文字幕一区二区三区| 一本久久精品一区二区| 99久久精品一区| 91麻豆高清视频| 91成人在线免费观看| 在线视频国内一区二区| 国产日韩精品一区二区三区 | 337p亚洲精品色噜噜狠狠| 色视频一区二区| 欧美精选在线播放| 日韩一区二区影院| 久久久久久97三级| 综合久久久久综合| 亚洲综合丁香婷婷六月香| 天天综合天天综合色| 精品中文字幕一区二区| 国产一区二区三区观看| 大美女一区二区三区| 99久精品国产| 欧美亚一区二区| 欧美一区中文字幕| 久久久久久一二三区| 中文字幕中文字幕在线一区| 一区二区在线电影| 日韩中文字幕区一区有砖一区| 日本vs亚洲vs韩国一区三区二区| 久久99精品一区二区三区| 成人免费毛片高清视频| 日本国产一区二区| 在线观看91精品国产麻豆| 欧美成人精品1314www| 国产精品视频你懂的| 一区二区久久久久久| 毛片一区二区三区| 波多野结衣中文字幕一区二区三区| 国产区在线观看成人精品| 亚洲色图欧洲色图| 蜜臀va亚洲va欧美va天堂| 成人黄页毛片网站| 3d动漫精品啪啪一区二区竹菊| 久久精品一区蜜桃臀影院| 亚洲精品欧美激情| 激情成人午夜视频| 91视频观看免费| 欧美电影免费观看完整版 | 麻豆免费看一区二区三区| 国产91精品在线观看| 欧美日韩国产一二三| 国产女主播在线一区二区| 亚洲第一电影网| 国产成人高清在线| 欧美久久久久久久久| 最新日韩在线视频| 久久国产精品露脸对白| 91国产视频在线观看| 久久久影院官网| 午夜欧美视频在线观看| 成人99免费视频| 日韩三级中文字幕| 亚洲国产一二三| 丁香激情综合国产| 日韩一区二区三区在线观看| 亚洲欧美另类小说视频| 国产精品一区二区黑丝| 91精品国产入口| 亚洲欧美日韩精品久久久久| 国产一区二区三区在线观看免费| 欧美喷水一区二区| 亚洲精品一二三| 99精品久久免费看蜜臀剧情介绍| 欧美精品一区二区三区视频| 天天亚洲美女在线视频| 色av综合在线| 亚洲欧洲国产日韩| 成人午夜激情影院| 久久午夜电影网| 麻豆精品一二三| 欧美精品一级二级| 亚洲影视在线播放| 一本久久综合亚洲鲁鲁五月天| 国产精品入口麻豆九色| 国产一区免费电影| 久久综合国产精品| 久久66热re国产| 日韩欧美另类在线| 日韩成人免费看| 91精品国产高清一区二区三区| 亚洲国产日韩a在线播放| 91麻豆高清视频| 一区二区日韩电影| 欧美系列日韩一区| 午夜欧美视频在线观看| 欧美日本视频在线| 青青草国产成人av片免费| 欧美一级片免费看| 美女脱光内衣内裤视频久久网站 | 五月天丁香久久| 欧美日本免费一区二区三区| 午夜精品久久久久久久99水蜜桃| 欧美日韩免费在线视频| 亚洲一级电影视频| 欧美日韩另类国产亚洲欧美一级| 亚洲高清久久久| 制服丝袜亚洲色图| 久久精品国产一区二区| xvideos.蜜桃一区二区| 国产suv精品一区二区三区| 中文久久乱码一区二区| www.日韩av| 一级精品视频在线观看宜春院| 欧美日本一区二区三区四区 | 亚洲第一福利一区| 日韩欧美一区二区在线视频| 激情文学综合网| 国产精品毛片a∨一区二区三区| 99视频在线观看一区三区| 亚洲免费资源在线播放| 欧美乱妇23p| 国产一区二三区好的| 中文字幕一区二区三区四区| 在线视频一区二区三区| 麻豆91精品91久久久的内涵| 国产欧美中文在线| 色婷婷亚洲精品| 美女脱光内衣内裤视频久久网站 | 欧美日韩久久不卡| 久久精品国产秦先生| 国产精品丝袜黑色高跟| 欧美专区亚洲专区| 国产一区欧美二区| 一区二区三区在线观看国产| 91精品福利在线一区二区三区| 国产成人av在线影院| 亚洲国产成人精品视频| 亚洲精品在线一区二区| 在线观看视频欧美| 国产麻豆视频一区二区| 亚洲国产欧美在线| 国产亚洲精品福利| 欧美精品黑人性xxxx| 懂色av中文字幕一区二区三区| 亚洲一区在线观看免费观看电影高清| 日韩免费在线观看| 91视频一区二区| 极品尤物av久久免费看| 一区二区三区欧美久久| 久久久国产精品麻豆| 777欧美精品| 91性感美女视频| 久久99精品久久久| 亚洲电影在线免费观看| 亚洲国产成人一区二区三区| 日韩午夜电影av| 欧洲色大大久久|