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

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

?? mp3encoder.c

?? 通過BIOS在DEC6713上實現了音頻的采樣與播放
?? C
字號:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/*
 *  ======== main.c ========
 * 
 *  This example demonstrates the use of IOM drivers with SIOs and tasks by 
 *  using the DIO class driver with a user defined device mini-driver 
 *  called "codec" and a class driver DIO instance called "dio_codec". This is 
 *  the loopback application where audio is read from an input SIO, then sent 
 *  back via an output SIO.

 *  The following objects need to be created in the DSP/BIOS
 *  configuration for this application:
 *
 *  * A UDEV object, which links in a user device driver. In this
 *    case the UDEV is a codec based IOM device driver.
 *  * A DIO object, which links the UDEV object.
 *  * A TSK object, with the function to run set to the function demo
 *    defined in this file.
 *  * A LOG named trace for debug and status output.
 */
#include <std.h>

#include <log.h>
#include <sys.h>
#include <mem.h>
#include <sio.h>
#include <csl.h>
#include <csl_cache.h>
#include <csl_i2c.h>
#include <csl_mcasp.h>

#include <dec6713.h>
#include <dec6713_edma_aic23.h>

#define NUM_CODEC_CHANNELS	 2	/* stereo: left + right		*/
#define SAMPLEING_RATE		48	/* 48 samples/ms			*/
#define FRAME_SIZE			10	/* 10 ms					*/
#define	NFRAMES				100	/* 100 frames = 1 second	*/
#define	BUFLEN		(NUM_CODEC_CHANNELS*SAMPLEING_RATE*FRAME_SIZE)

#ifdef _6x_
extern far LOG_Obj trace;

/* 
 * Buffers placed in external memory are aligned on a 128 bytes boundary.
 * In addition, the buffer should be of a size multiple of 128 bytes for 
 * the cache work optimally on the C6x.
 */
#define BUFALIGN 128    /* alignment of buffer to allow use of L2 cache */
#else
extern LOG_Obj trace;
#define BUFALIGN 1
#endif

#define BUFSIZE (BUFLEN * sizeof(short)) 

/*
 *  ======== DEC6713_DEVPARAMS ========
 *  This static initialization defines the default parameters used for
 *  DEC6713_EDMA_AIC23 IOM driver
 */
DEC6713_EDMA_AIC23_DevParams DEC6713_CODEC_DEVPARAMS =
        DEC6713_EDMA_AIC23_DEFAULT_DEVPARAMS;

/* inStream and outStream are SIO handles created in main */
SIO_Handle inStream, outStream;

/* Function prototype */
static Void prime();
static Void PlayAudio();
/*
 * ======== main ========
 */
Void main()
{
	//DEC6713_LED_init();
    LOG_printf(&trace, "echo started");
}

short *pEchoBuf;
const int echoBufSize = NFRAMES * BUFLEN;
int echoBufOffset = 0;
int delayTime = 500;
int echoAtt = 64;

/*
 *  ======== initEchoBuffer ========
 * Allocate echo buffer and fill with silence
 */
int initEchoBuffer()
{
	pEchoBuf = MEM_calloc(0, echoBufSize * sizeof(short), BUFALIGN);
	return (pEchoBuf == MEM_ILLEGAL) ? -1 : 0;
}

/*
 *  ======== copyWithEcho ========
 * Copy an incoming buffer with stereo audio samples into an outgoing
 * buffer, mixing with samples from the echo buffer indexed by
 * the parameter timeDelay.  The parameter "a" indicates the mix
 * attenuation * 256 (i.e. 64 = 0.25).
 */
void PlayAudio(short *inBuf, short *outBuf)
{
	int i;
	for(i=0;i<BUFLEN;i++)
	{
		*outBuf++ = *inBuf++;
	}
}

/*
 * ======== createStreams ========
 */
static Void createStreams()
{
    SIO_Attrs attrs;
    
    /* align the buffer to allow it to be used with L2 cache */
    attrs = SIO_ATTRS;
    attrs.align = BUFALIGN;
    attrs.model = SIO_ISSUERECLAIM;
	LOG_printf(&trace, "echo started");
    /* open the I/O streams */
    inStream = SIO_create("/dio_codec", SIO_INPUT, BUFSIZE, &attrs);
    LOG_printf(&trace, "echo started");
    if (inStream == NULL) {
        SYS_abort("Create input stream FAILED.");
    }

    outStream = SIO_create("/dio_codec", SIO_OUTPUT, BUFSIZE, &attrs);
    if (outStream == NULL) {
        SYS_abort("Create output stream FAILED.");
    }
}

/*
 * ======== prime ========
 */
static Void prime()
{
    Ptr buf0, buf1, buf2, buf3;

    LOG_printf(&trace, "Allocate buffers started");

    /* Allocate buffers for the SIO buffer exchanges */
    buf0 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf1 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf2 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf3 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    if (buf0 == NULL || buf1 == NULL || buf2 == NULL || buf3 == NULL) {
        SYS_abort("MEM_calloc failed.");
    } 
    
    /* Issue the first & second empty buffers to the input stream */
    if (SIO_issue(inStream, buf0, SIO_bufsize(inStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the input stream");
    }
    if (SIO_issue(inStream, buf1, SIO_bufsize(inStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the input stream");
    }

    /* Issue the first & second empty buffers to the output stream */
    if (SIO_issue(outStream, buf2, SIO_bufsize(outStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the output stream");
    }
    if (SIO_issue(outStream, buf3, SIO_bufsize(outStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the output stream");
    }
}

/*
 * ======== tskAudioDemo ========
 * This function copies from the input SIO to the output SIO. You could
 * easily replace the copy function with a signal processing algorithm. 
 */
Void tsk_Audio()
{
    Int nmadus;         /* number of minimal addressable units */
    short *inbuf, *outbuf;

	/* Call createStream function to create I/O streams */
    createStreams();
    
    /* Call prime function to do priming */
    prime();
    
    initEchoBuffer();

    /* Loop forever looping back buffers */
    for (;;) {
        /* Reclaim full buffer from the input stream */
        if ((nmadus = SIO_reclaim(inStream, (Ptr *)&inbuf, NULL)) < 0) {
            SYS_abort("Error reclaiming full buffer from the input stream");
        }

        /* Reclaim empty buffer from the output stream to be reused */
        if (SIO_reclaim(outStream, (Ptr *)&outbuf, NULL) < 0) {
            SYS_abort("Error reclaiming empty buffer from the output stream");
        }

		/* process echo algorithm */
		PlayAudio(inbuf, outbuf);
		
        /* Issue full buffer to the output stream */
        if (SIO_issue(outStream, outbuf, nmadus, NULL) != SYS_OK) {
            SYS_abort("Error issuing full buffer to the output stream");
        }

        /* Issue an empty buffer to the input stream */
        if (SIO_issue(inStream, inbuf, SIO_bufsize(inStream), NULL) != SYS_OK) {
            SYS_abort("Error issuing empty buffer to the input stream");
        }
    }
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人猛片aaaaaaa| 一区二区在线免费| 亚洲视频 欧洲视频| 麻豆视频观看网址久久| 国产黑丝在线一区二区三区| 欧美亚洲禁片免费| 国产精品毛片无遮挡高清| 首页亚洲欧美制服丝腿| 99精品视频中文字幕| 精品久久久久久亚洲综合网| 亚洲二区视频在线| 99久久精品国产一区| 国产麻豆视频精品| 91在线一区二区| 精品国产乱码久久久久久夜甘婷婷| 国产精品不卡视频| 午夜精品福利久久久| 色呦呦一区二区三区| 国产清纯在线一区二区www| 老司机免费视频一区二区 | 亚洲美腿欧美偷拍| 国产中文字幕一区| 欧美va在线播放| 蜜臀av性久久久久av蜜臀妖精 | 777色狠狠一区二区三区| 国产精品视频看| 国产乱人伦偷精品视频不卡| 精品精品欲导航| 久久不见久久见免费视频7| 欧美刺激午夜性久久久久久久| 久久女同精品一区二区| 久久成人av少妇免费| 日韩欧美亚洲另类制服综合在线| 精品三级在线观看| 麻豆中文一区二区| 精品成人a区在线观看| 日韩av一区二区三区| 在线播放一区二区三区| 麻豆成人在线观看| 精品国产乱子伦一区| 国产1区2区3区精品美女| 国产精品色一区二区三区| 91美女蜜桃在线| 亚洲综合图片区| 欧美日韩电影一区| 奇米一区二区三区| 久久精品欧美一区二区三区不卡| 亚洲1区2区3区视频| 精品理论电影在线| 成人动漫av在线| 一区二区欧美在线观看| 欧美日韩国产免费| 九九国产精品视频| 久久久美女毛片| 一本到不卡免费一区二区| 视频一区在线视频| 久久精品亚洲一区二区三区浴池 | 久久精品国产精品亚洲综合| 精品国产一二三| www.综合网.com| 亚洲自拍与偷拍| www一区二区| 91视频免费播放| 日本91福利区| 成人欧美一区二区三区黑人麻豆| 蜜臀av一级做a爰片久久| 精品盗摄一区二区三区| 99国产精品久| 国内精品久久久久影院色| 亚洲视频网在线直播| 91精品国产综合久久精品图片| 亚洲视频图片小说| 日韩欧美国产一区二区在线播放| 亚洲一二三级电影| 久久女同精品一区二区| 欧美丝袜丝nylons| 成人影视亚洲图片在线| 午夜精品福利一区二区三区av| 欧美亚洲高清一区| 激情五月播播久久久精品| 亚洲日韩欧美一区二区在线| 精品久久国产字幕高潮| 欧洲av一区二区嗯嗯嗯啊| 成人免费精品视频| 老色鬼精品视频在线观看播放| 日韩欧美一级二级| 色婷婷av一区二区三区软件| 国产一区二区三区不卡在线观看| 精品动漫一区二区三区在线观看| 日韩电影在线观看一区| 国产精品区一区二区三区| 9191成人精品久久| 91色在线porny| 国产成人精品免费| 韩国精品久久久| 天天综合网 天天综合色| 亚洲猫色日本管| 国产精品久线在线观看| 久久精品一区二区三区不卡牛牛| 国产一区二区三区四区五区入口 | 成人一区二区三区| 国内精品在线播放| 美日韩一区二区| 日韩精品91亚洲二区在线观看| 欧美mv日韩mv国产网站| 欧美日韩日日摸| 91黄色激情网站| 色悠悠亚洲一区二区| 99精品欧美一区二区蜜桃免费| 玉足女爽爽91| 亚洲男人的天堂网| 一区二区三区在线观看动漫| 国产精品久久久久一区二区三区 | 成人黄色国产精品网站大全在线免费观看| 久久女同互慰一区二区三区| 日韩欧美你懂的| 日韩三级在线免费观看| 日韩免费视频一区| 日韩欧美一级片| 26uuu国产日韩综合| 国产午夜精品一区二区三区视频 | 国产不卡在线视频| 国产电影一区在线| 国产91丝袜在线18| 91在线高清观看| 欧美体内she精视频| 欧美精品 国产精品| 91精品国产乱码久久蜜臀| 精品美女一区二区三区| 欧美国产综合一区二区| 亚洲天堂免费看| 亚洲第一电影网| 久久黄色级2电影| 成人午夜视频网站| 在线免费亚洲电影| 日韩精品一区二区三区在线播放 | 国产日本欧洲亚洲| 国产欧美日韩久久| 一区二区三区欧美在线观看| 爽好久久久欧美精品| 国产精品一区三区| 色婷婷综合在线| 在线91免费看| 国产日韩欧美麻豆| 亚洲一区在线观看免费| 激情深爱一区二区| 91小视频在线免费看| 欧美一区二区大片| 国产精品毛片大码女人| 亚洲成人av中文| 风间由美一区二区三区在线观看| 麻豆成人免费电影| 不卡一卡二卡三乱码免费网站| 久久成人麻豆午夜电影| 99国产欧美另类久久久精品| 欧美日韩精品系列| 国产精品天干天干在观线| 夜夜嗨av一区二区三区四季av | 欧美日韩高清一区| 久久免费美女视频| 亚洲国产日韩一区二区| 风间由美一区二区av101 | 看电视剧不卡顿的网站| 成人av免费观看| 精品国产伦一区二区三区观看体验| 91精品国产综合久久久久久| 中文文精品字幕一区二区| 日韩精品欧美精品| 色猫猫国产区一区二在线视频| 91香蕉视频在线| 久久五月婷婷丁香社区| 亚洲国产另类av| 91丨porny丨中文| 久久久久久一二三区| 天堂成人免费av电影一区| 成人精品免费看| 2020国产精品自拍| 美女免费视频一区| 欧美在线|欧美| 亚洲色图20p| 国产成人激情av| 精品国偷自产国产一区| 欧美a级一区二区| 欧美电影一区二区三区| 亚洲一区二区三区四区不卡| 成人app在线| 国产精品网站在线观看| 国产精品一区二区男女羞羞无遮挡| 成人精品在线视频观看| 精品国产乱码久久久久久久 | 夜夜嗨av一区二区三区| 成人中文字幕电影| 国产精品三级av| 国模套图日韩精品一区二区 | 日韩免费观看2025年上映的电影| 日韩免费高清av| 性久久久久久久久久久久| 91福利视频在线| 一区二区三区中文字幕电影| 色综合天天做天天爱|