3720
- 收藏
- 点赞
- 分享
- 举报
关于hi3520d audio 的问题
运行sample_audio 先保存音频文件,然后在运行sample_audio播放这个音频文件,全是噪音,感觉是播放的声音慢了好几倍,听不出原声了。其他的没改,就是我用cool edit pro 播放这个文件,设成单声道,48000采样率是可以播放正常的。不知道什么原因
下面是我的设置
ai就直接使用默认设置,这个我比较郁闷,为什么要48000采样率才是正常的,这里的采样率明明是8000 双通道,不过说明采样还是成功的
/* init stAio. all of cases will use it */
stAioAttr.enSamplerate = AUDIO_SAMPLE_RATE_8000;
stAioAttr.enBitwidth = AUDIO_BIT_WIDTH_16;
stAioAttr.enWorkmode = AIO_MODE_I2S_SLAVE;
stAioAttr.enSoundmode = AUDIO_SOUND_MODE_MONO;
stAioAttr.u32EXFlag = 1;
stAioAttr.u32FrmNum = 30;
stAioAttr.u32PtNumPerFrm = SAMPLE_AUDIO_PTNUMPERFRM;
stAioAttr.u32ChnCnt = 2;
stAioAttr.u32ClkSel = 0;
下面是我ao的设置,因为我用的是HDMI输出,所以有点小改动,hdmi是运行正常了,但是声音变得好慢好慢,
HI_S32 SAMPLE_AUDIO_AdecAo(AIO_ATTR_S *pstAioAttr)
{
HI_S32 s32Ret;
AUDIO_DEV AoDev = SAMPLE_AUDIO_HDMI_AO_DEV;
AO_CHN AoChn = 1;
ADEC_CHN AdChn = 0;
FILE *pfd = NULL;
AUDIO_RESAMPLE_ATTR_S stAoReSampleAttr;
AIO_ATTR_S stHdmiAoAttr;
gs_pstAiReSmpAttr = NULL;
/* ao 8k -> 48k */
stAoReSampleAttr.u32InPointNum = SAMPLE_AUDIO_PTNUMPERFRM;
stAoReSampleAttr.enInSampleRate = AUDIO_SAMPLE_RATE_8000;
stAoReSampleAttr.enReSampleType = AUDIO_RESAMPLE_1X4;
gs_pstAoReSmpAttr = &stAoReSampleAttr;
memcpy(&stHdmiAoAttr, pstAioAttr, sizeof(AIO_ATTR_S));
stHdmiAoAttr.enBitwidth = AUDIO_BIT_WIDTH_16;
stHdmiAoAttr.enSamplerate = AUDIO_SAMPLE_RATE_32000;
stHdmiAoAttr.u32PtNumPerFrm = pstAioAttr->u32PtNumPerFrm * 4;
stHdmiAoAttr.enWorkmode = AIO_MODE_I2S_MASTER;
stHdmiAoAttr.u32ChnCnt = 2;
if (NULL == pstAioAttr)
{
printf("[Func]:%s [Line]:%d [Info]:%s\n", __FUNCTION__, __LINE__, "NULL pointer");
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_CfgAcodec(pstAioAttr, gs_bMicIn);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_StartAdec(AdChn, gs_enPayloadType);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_StartAo(AoDev, AoChn, &stHdmiAoAttr, gs_pstAoReSmpAttr);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_AoBindAdec(AoDev, AoChn, AdChn);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
pfd = SAMPLE_AUDIO_OpenAdecFile(AdChn, gs_enPayloadType);
if (!pfd)
{
SAMPLE_DBG(HI_FAILURE);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_CreatTrdFileAdec(AdChn, pfd);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
printf("bind adec:%d to ao(%d,%d) ok \n", AdChn, AoDev, AoChn);
printf("\nplease press twice ENTER to exit this sample\n");
getchar();
getchar();
SAMPLE_COMM_AUDIO_DestoryTrdFileAdec(AdChn);
SAMPLE_COMM_AUDIO_StopAo(AoDev, AoChn, gs_bAioReSample);
SAMPLE_COMM_AUDIO_StopAdec(AdChn);
SAMPLE_COMM_AUDIO_AoUnbindAdec(AoDev, AoChn, AdChn);
return HI_SUCCESS;
}
下面是我的设置
ai就直接使用默认设置,这个我比较郁闷,为什么要48000采样率才是正常的,这里的采样率明明是8000 双通道,不过说明采样还是成功的
/* init stAio. all of cases will use it */
stAioAttr.enSamplerate = AUDIO_SAMPLE_RATE_8000;
stAioAttr.enBitwidth = AUDIO_BIT_WIDTH_16;
stAioAttr.enWorkmode = AIO_MODE_I2S_SLAVE;
stAioAttr.enSoundmode = AUDIO_SOUND_MODE_MONO;
stAioAttr.u32EXFlag = 1;
stAioAttr.u32FrmNum = 30;
stAioAttr.u32PtNumPerFrm = SAMPLE_AUDIO_PTNUMPERFRM;
stAioAttr.u32ChnCnt = 2;
stAioAttr.u32ClkSel = 0;
下面是我ao的设置,因为我用的是HDMI输出,所以有点小改动,hdmi是运行正常了,但是声音变得好慢好慢,
HI_S32 SAMPLE_AUDIO_AdecAo(AIO_ATTR_S *pstAioAttr)
{
HI_S32 s32Ret;
AUDIO_DEV AoDev = SAMPLE_AUDIO_HDMI_AO_DEV;
AO_CHN AoChn = 1;
ADEC_CHN AdChn = 0;
FILE *pfd = NULL;
AUDIO_RESAMPLE_ATTR_S stAoReSampleAttr;
AIO_ATTR_S stHdmiAoAttr;
gs_pstAiReSmpAttr = NULL;
/* ao 8k -> 48k */
stAoReSampleAttr.u32InPointNum = SAMPLE_AUDIO_PTNUMPERFRM;
stAoReSampleAttr.enInSampleRate = AUDIO_SAMPLE_RATE_8000;
stAoReSampleAttr.enReSampleType = AUDIO_RESAMPLE_1X4;
gs_pstAoReSmpAttr = &stAoReSampleAttr;
memcpy(&stHdmiAoAttr, pstAioAttr, sizeof(AIO_ATTR_S));
stHdmiAoAttr.enBitwidth = AUDIO_BIT_WIDTH_16;
stHdmiAoAttr.enSamplerate = AUDIO_SAMPLE_RATE_32000;
stHdmiAoAttr.u32PtNumPerFrm = pstAioAttr->u32PtNumPerFrm * 4;
stHdmiAoAttr.enWorkmode = AIO_MODE_I2S_MASTER;
stHdmiAoAttr.u32ChnCnt = 2;
if (NULL == pstAioAttr)
{
printf("[Func]:%s [Line]:%d [Info]:%s\n", __FUNCTION__, __LINE__, "NULL pointer");
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_CfgAcodec(pstAioAttr, gs_bMicIn);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_StartAdec(AdChn, gs_enPayloadType);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_StartAo(AoDev, AoChn, &stHdmiAoAttr, gs_pstAoReSmpAttr);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_AoBindAdec(AoDev, AoChn, AdChn);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
pfd = SAMPLE_AUDIO_OpenAdecFile(AdChn, gs_enPayloadType);
if (!pfd)
{
SAMPLE_DBG(HI_FAILURE);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_AUDIO_CreatTrdFileAdec(AdChn, pfd);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_DBG(s32Ret);
return HI_FAILURE;
}
printf("bind adec:%d to ao(%d,%d) ok \n", AdChn, AoDev, AoChn);
printf("\nplease press twice ENTER to exit this sample\n");
getchar();
getchar();
SAMPLE_COMM_AUDIO_DestoryTrdFileAdec(AdChn);
SAMPLE_COMM_AUDIO_StopAo(AoDev, AoChn, gs_bAioReSample);
SAMPLE_COMM_AUDIO_StopAdec(AdChn);
SAMPLE_COMM_AUDIO_AoUnbindAdec(AoDev, AoChn, AdChn);
return HI_SUCCESS;
}
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2017-08-10 09:46:22
-
2017-01-02 10:30:44
-
2018-03-20 16:03:07
-
2017-06-27 14:51:50
-
2014-07-31 13:32:21
-
2020-04-27 14:32:44
-
2017-06-14 11:17:32
-
2018-06-03 11:29:15
-
2016-11-08 18:00:35
-
2016-03-25 15:18:43
-
2019-09-30 16:39:00
-
2015-11-02 10:35:09
-
02013-12-26 15:33:24
-
12017-03-08 18:36:15
-
2018-03-16 16:45:56
-
2014-08-05 21:15:43
-
2020-04-23 18:27:38
-
2016-03-09 20:52:30
-
2017-08-14 14:28:15
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认