⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audio_comm.h

📁 sample on embedded linux
💻 H
字号:
/******************************************************************************  Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ******************************************************************************  File Name     : audio_comm.h  Version       : Initial Draft  Author        : Hisilicon multimedia software group  Created       : 2006/12/19  Description   :   History       :  1.Date        : 2006/12/19    Author      : Z44949    Modification: Created file******************************************************************************/#ifndef __AUDIO_COMM_H__#define __AUDIO_COMM_H__#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/ioctl.h>#include "hi_common_api.h"/* Define the sample rate which AD supported */#define  SET_TLV_SAMPLERATE 0xaF01#define  SET_8K_SAMPLERATE  0#define  SET_32K_SAMPLERATE 3#define  SET_48K_SAMPLERATE 5   #define AAC_CHANNEL_SUPPORT 2                /* The channles supported by AAC */#define AAC_MAX_BANDWIDTH   20000            /* The max bandwidth             *//* Set the AD's sample rate */static HI_VOID SetADSampleRate(HI_U32 sample){	    HI_S32 fd;    HI_U32 tmp;    /* We use TLV320 as audio AD */    fd = open("/dev/misc/tlv320",O_NONBLOCK);	if (fd < 0) 	{    	perror("tlv320");    	exit(1);	}    tmp = sample;	ioctl(fd, SET_TLV_SAMPLERATE,&tmp);		close(fd);}/* Set the AI's sample rate */static HI_S32 SetAiSampleRate(AI_CHN ai_chnid, AUDIO_SAMPLE_RATE_E enSample){    AUDIO_CH_ATTR_S strAttr;    HI_S32          s32Ret;    s32Ret = HI_AENC_GetAIAttr(ai_chnid, &strAttr);    ASSERT_RETURN((HI_SUCCESS == s32Ret), s32Ret);        strAttr.enSampleRate = enSample;    s32Ret = HI_AENC_SetAIAttr(ai_chnid, &strAttr);    ASSERT_RETURN((HI_SUCCESS == s32Ret), s32Ret);    return HI_SUCCESS;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -