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

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

?? cbuf.cpp

?? 一個(gè)語音信號端點(diǎn)檢測的程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//// Circular buffer member functions//// Bruce T. Lowerre, Public domain, 1995, 1997//// $Log: cbuf.cc,v $// Revision 1.6  1997/08/06 19:35:15  lowerre// removed sampling rate from classes//// Revision 1.5  1997/07/30 19:26:29  lowerre// modifies read and peek routines, again!//// Revision 1.4  1997/07/21 22:13:11  lowerre// found bugs in the read routines, reader not being updated properly//// Revision 1.3  1997/06/04 18:50:03  lowerre// added eod check to available read// fixed eod check in peek and read//// Revision 1.2  1997/06/04 18:14:42  lowerre// added eod boolean to read and peek//// Revision 1.1  1997/05/14 20:02:24  lowerre// Initial revision///////* * This defines the cbuf (circular buffer) class routines.  This class is used to * handle speech utterances, which are either pre-recorded or live. */#include "cbuf.h"#include <string.h>/* * CBUF_CHAR::CBUF_CHAR - the class constructor for a circular buffer of size usize *		It is assumed that the samples are bytes (either mu-law or a-law). *              The buffer length is allocated with 4 additional bytes because *              the start and end markers take room. */cbuf_char::cbuf_char(   long	usize			// size of circular buffer){    buffer = new char[usize + 4];	// the actual buffer    size = usize;    reset ();} // end cbuf_char::cbuf_char/* * CBUF_SHORT::CBUF_SHORT - the class constructor for a circular buffer of size usize *		It is assumed that the samples are shorts. *              The buffer length is allocated with 4 additional shorts because *              the start and end markers take room. */cbuf_short::cbuf_short(    long	usize			// size of circular buffer){    buffer = new short[usize + 4];	// the actual buffer    size = usize;    reset ();} // end cbuf_short::cbuf_short/* * CBUF_LONG::CBUF_LONG - the class constructor for a circular buffer of size usize *		It is assumed that the samples are longs. *              The buffer length is allocated with 4 additional longs because *              the start and end markers take room. */cbuf_long::cbuf_long(    long	usize			// size of circular buffer){    buffer = new long[usize + 4];	// the actual buffer    size = usize;    reset ();} // end cbuf_long::cbuf_long/* * CBUF_FLOAT::CBUF_FLOAT - the class constructor for a circular buffer of size usize *		It is assumed that the samples are floats. *              The buffer length is allocated with 4 additional shorts because *              the start and end markers take room. */cbuf_float::cbuf_float(    long	usize			// size of circular buffer){    buffer = new float[usize + 4];	// the actual buffer    size = usize;    reset ();} // end cbuf_float::cbuf_float/* * CBUF::AVAILABLE_READ - get the number of elements available to read *                        This is complicated by the circular nature of the *                        buffer plus the eod marker. */long cbuf::available_read(    BOOLEAN	ckeod			// if True, then check eod marker){    long	first = reader,		// first actual element available		last = writer;		// last actual element available + 1    if (ckeod && eod >= 0)        last = eod;			// end of data has been set    if (last < first)        last += size;			// wraps around    return (last - first);} // end cbuf::available_read/* * CBUF::AVAILABLE_READALL - get the number of elements available to readall *                           This is complicated by the circular nature of the *                           buffer plus the eod marker. */long cbuf::available_readall (){    long	first,			// first actual element available		last;			// last actual element available + 1    if (keeper < 0)        first = reader;			// keeper not set    else        first = keeper;    if (eod >= 0)        last = eod;			// set last available    else    if ((last = writer - 1) < 0)        last += size;			// wrap around    if (last < first)        last += size;			// wraps around    return (last - first);} // end cbuf::available_readall/* * CBUF::AVAILABLE_WRITE - get the number of empty elements available to write *                         This is complicated by the circular nature of the *                         buffer plus the keeper pointer. */long cbuf::available_write (){    long	first = writer,		// first element available		last = reader;		// last element available + 1    if (keeper >= 0)        last = keeper;			// keeper has been set    if (last <= first)        last += size;			// wraps around    return (last - first);} // end cbuf::available_write/* * CBUF::SETKEEPER - Set the keeper pointer count number of elements before *                   the current read pointer.  There is no error for wrap around. */void cbuf::setkeeper(    long	count			// set the keeper count elements before reader){    keeper = reader - count;    while (keeper < 0)        keeper += size;			// wraps around} // end cbuf::setkeeper/* * CBUF::SETEOD - Set the eod (end of data) pointer count number of elements before *                the current read pointer.  There is no error for wrap around. */void cbuf::seteod(    long	count			// set the eod count elements before reader){    if (count < 0)        eod = writer;			// set to the writer pointer    else    {        eod = reader - count;        while (eod < 0)            eod += size;		// wraps around    }} // end cbuf::seteod/* * CBUF::ADVANCEOD - Advance the eod (end of data) pointer the specified number of elements. */void cbuf::advanceod(    long	count			// number of elements to advance){    eod += count;    while (eod >= size)        eod -= size;} // end cbuf::advanceod/* * CBUF_CHAR::READ - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              The reader pointer is updated. */long cbuf_char::read(    char	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; reader++)    {        if (reader >= size)            reader -= size;		// wrap around        if (reader == lastw)            break;        where[count++] = buffer[reader];// move one element    }    return (count);} // end cbuf_char::read/* * CBUF_SHORT::READ - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              The reader pointer is updated. */long cbuf_short::read(    short	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; reader++)    {        if (reader >= size)            reader -= size;		// wrap around        if (reader == lastw)            break;        where[count++] = buffer[reader];// move one element    }    return (count);} // end cbuf_short::read/* * CBUF_LONG::READ - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              The reader pointer is updated. */long cbuf_long::read(    long	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; reader++)    {        if (reader >= size)            reader -= size;		// wrap around        if (reader == lastw)            break;        where[count++] = buffer[reader];// move one element    }    return (count);} // end cbuf_long::read/* * CBUF_FLOAT::READ - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              The reader pointer is updated. */long cbuf_float::read(    float	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; reader++)    {        if (reader >= size)            reader -= size;		// wrap around        if (reader == lastw)            break;        where[count++] = buffer[reader];// move one element    }    return (count);} // end cbuf_float::read/* * CBUF_CHAR::PEEK - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              Same as read but the reader pointer is NOT updated. */long cbuf_char::peek(    char	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		rdr = reader,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; rdr++)    {        if (rdr >= size)            rdr -= size;		// wrap around        if (rdr == lastw)            break;        where[count++] = buffer[rdr];	// move one element    }    return (count);} // end cbuf_char::peek/* * CBUF_SHORT::PEEK - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              Same as read but the reader pointer is NOT updated. */long cbuf_short::peek(    short	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		rdr = reader,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; rdr++)    {        if (rdr >= size)            rdr -= size;		// wrap around        if (rdr == lastw)            break;        where[count++] = buffer[rdr];	// move one element    }    return (count);} // end cbuf_short::peek/* * CBUF_LONG::PEEK - Read up to howmany elements from the circular buffer and place *              them in where.  Return number of elements actually read. *              Same as read but the reader pointer is NOT updated. */long cbuf_long::peek(    long	*where,			// where to put it    long	howmany,		// how many to read    BOOLEAN	ckeod			// if True, don't read past eod marker){    long	count,		rdr = reader,		lastw;    if (ckeod && eod >= 0)        lastw = eod;    else        lastw = writer;    for (count = 0; count < howmany; rdr++)    {        if (rdr >= size)            rdr -= size;		// wrap around        if (rdr == lastw)            break;        where[count++] = buffer[rdr];	// move one element

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩中文字幕91| 丝袜亚洲另类丝袜在线| 欧美三级欧美一级| 亚洲一区在线视频| 精品日产卡一卡二卡麻豆| 国产成人精品亚洲午夜麻豆| 亚洲国产精品尤物yw在线观看| 精品国产伦一区二区三区免费| 97精品国产露脸对白| 午夜国产不卡在线观看视频| 久久综合九色综合久久久精品综合| 99精品欧美一区二区三区小说| 国产v日产∨综合v精品视频| 性感美女极品91精品| 国产精品系列在线| 欧美变态凌虐bdsm| 久久久久久久久久久久电影 | 91亚洲永久精品| 韩国一区二区三区| 亚洲大片在线观看| 蜜臀精品久久久久久蜜臀| 亚洲欧美日韩国产综合在线| 亚洲精品在线观| 国产偷国产偷亚洲高清人白洁| 91精品国产综合久久香蕉的特点| 成人av网站大全| 国产在线精品一区二区夜色| 1024国产精品| 国产精品毛片久久久久久久| 久久久久9999亚洲精品| 亚洲欧洲精品成人久久奇米网| 亚洲自拍偷拍麻豆| 另类小说视频一区二区| 亚洲成精国产精品女| 美女任你摸久久| 国产suv精品一区二区883| 色婷婷综合在线| jizzjizzjizz欧美| 99视频超级精品| 欧美精品视频www在线观看| 欧美日韩另类国产亚洲欧美一级| 欧美性videosxxxxx| 972aa.com艺术欧美| 欧美一区二区视频网站| 欧美丰满美乳xxx高潮www| 精品嫩草影院久久| 亚洲精品高清视频在线观看| 亚洲欧美日韩国产手机在线| 日本美女一区二区| 久久99最新地址| 91色九色蝌蚪| 精品日产卡一卡二卡麻豆| 一区二区三区在线免费播放| 一区二区三区在线视频观看58| 麻豆成人免费电影| 91麻豆swag| 亚洲国产精品ⅴa在线观看| 中文字幕一区二区三区在线观看 | 欧美老年两性高潮| 中文字幕一区二区三区乱码在线 | 久久在线观看免费| 日本美女一区二区| 欧美体内she精高潮| 中文字幕日韩精品一区| 国产一区美女在线| 91精品国产综合久久精品性色| 亚洲免费观看高清完整版在线观看熊| 国产麻豆精品在线观看| 欧美一区二区大片| 偷窥少妇高潮呻吟av久久免费 | 国产精品嫩草影院av蜜臀| 美国十次综合导航| 在线不卡一区二区| 午夜欧美一区二区三区在线播放| 亚洲一区二区在线播放相泽| 91丝袜美女网| 亚洲色图丝袜美腿| 偷窥国产亚洲免费视频| 欧洲国内综合视频| 久久精品欧美一区二区三区麻豆| 蜜桃精品在线观看| 欧美一区二区三级| 麻豆国产91在线播放| 欧美本精品男人aⅴ天堂| 蜜臀av一区二区| ww亚洲ww在线观看国产| 狠狠网亚洲精品| 久久精品免费在线观看| 福利一区福利二区| 国产精品国产三级国产普通话三级| 亚洲成人综合在线| 欧美片在线播放| 免费的国产精品| 欧洲人成人精品| 亚洲va国产天堂va久久en| 欧美区一区二区三区| 久久国产综合精品| 日本一区二区不卡视频| 99久久精品国产毛片| 一个色综合网站| 欧美一区二区三区四区久久| 国产在线日韩欧美| 亚洲色图制服诱惑| 欧美一级一级性生活免费录像| 久久国内精品自在自线400部| 国产免费成人在线视频| 国产麻豆精品在线观看| 国产精品久久久久久户外露出| 91成人在线观看喷潮| 1区2区3区国产精品| 欧美日韩亚洲综合一区二区三区| 另类欧美日韩国产在线| 国产精品成人免费精品自在线观看 | 国产精品久久久一本精品| 色8久久精品久久久久久蜜| 蜜臀精品一区二区三区在线观看 | 午夜影院久久久| 国产亚洲一区二区在线观看| 91久久久免费一区二区| 免费日韩伦理电影| 亚洲欧美偷拍另类a∨色屁股| 91精品久久久久久蜜臀| av激情亚洲男人天堂| 麻豆成人91精品二区三区| 亚洲天堂久久久久久久| 欧美videofree性高清杂交| 91麻豆免费观看| 国产成人在线看| 日韩精品91亚洲二区在线观看| 国产精品国产成人国产三级| 欧美一区二区三区系列电影| 一本色道久久综合狠狠躁的推荐| 久久精品久久精品| 亚洲精品国产无天堂网2021 | 色偷偷成人一区二区三区91| 国产精品一级二级三级| 精品剧情在线观看| 精品视频1区2区| 91女人视频在线观看| 国产一区二区主播在线| 日韩国产在线一| 亚洲一级二级三级在线免费观看| 中文字幕欧美区| 久久久久国产精品免费免费搜索| 欧美精品vⅰdeose4hd| 色综合夜色一区| 亚洲制服丝袜一区| 亚洲女性喷水在线观看一区| 国产精品免费aⅴ片在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 亚洲国产精品影院| 中文字幕av一区 二区| 久久久精品免费观看| 日韩欧美中文字幕一区| 国产麻豆视频一区| 国产精品99久久久久久久女警| 人人狠狠综合久久亚洲| 爽好久久久欧美精品| 天堂一区二区在线| 午夜av一区二区| 日韩制服丝袜先锋影音| 首页亚洲欧美制服丝腿| 日本欧美一区二区三区| 日韩激情视频网站| 日韩不卡一区二区三区 | 精品毛片乱码1区2区3区| 日韩女优电影在线观看| 成人18精品视频| 93久久精品日日躁夜夜躁欧美| 99这里只有精品| 一本到高清视频免费精品| 在线精品视频一区二区三四| 欧美色图激情小说| 欧美一区二区免费视频| 久久亚洲精品小早川怜子| 久久久久久免费| 亚洲图片激情小说| 婷婷六月综合亚洲| 激情成人午夜视频| 99久久精品情趣| 3atv一区二区三区| 久久先锋影音av| 亚洲图片你懂的| 日本欧美久久久久免费播放网| 久久成人精品无人区| 国产91精品免费| 在线观看不卡视频| 欧美精品一区二区三区蜜桃视频| 国产精品三级视频| 午夜精彩视频在线观看不卡| 国产超碰在线一区| 欧美视频一区在线观看| 精品国产sm最大网站| 日韩伦理电影网| 国产一区二区久久| 欧美午夜精品久久久| 国产午夜精品一区二区三区四区| 一区二区三区四区在线播放| 精东粉嫩av免费一区二区三区| 日韩中文字幕区一区有砖一区|