diff --git a/cplusplus/level1_single_api/6_media/1_audio/audio_gitee/sample_audio.c b/cplusplus/level1_single_api/6_media/1_audio/audio_gitee/sample_audio.c index 86960a03bfba1d6800f614bbf9b627ba7d50b7b1..19e33641e49adef4e2f50ccdfe49a533310c1550 100644 --- a/cplusplus/level1_single_api/6_media/1_audio/audio_gitee/sample_audio.c +++ b/cplusplus/level1_single_api/6_media/1_audio/audio_gitee/sample_audio.c @@ -54,12 +54,13 @@ hi_s32 sample_comm_sys_init(void) static hi_void sample_audio_aio_init_param(hi_aio_attr *aio_attr) { - aio_attr->chn_cnt = 1; + aio_attr->chn_cnt = 2; aio_attr->point_num_per_frame = 960; aio_attr->expand_flag = 0; aio_attr->frame_num = 30; aio_attr->clk_share = 1; - aio_attr->snd_mode = HI_AUDIO_SOUND_MODE_MONO; + // aio_attr->snd_mode = HI_AUDIO_SOUND_MODE_MONO; /* single voice */ + aio_attr->snd_mode = HI_AUDIO_SOUND_MODE_STEREO; /* double voice */ aio_attr->sample_rate = HI_AUDIO_SAMPLE_RATE_48000; aio_attr->bit_width = HI_AUDIO_BIT_WIDTH_16; aio_attr->work_mode = HI_AIO_MODE_I2S_MASTER; @@ -239,6 +240,7 @@ static hi_s32 audio_ai_get_frame_and_send(sample_ai *ai_ctl, FILE *capture_fd) } fwrite(frame.virt_addr[0], 1, frame.len, capture_fd); + fwrite(frame.virt_addr[1], 1, frame.len, capture_fd); /* finally you must release the stream */ ret = hi_mpi_ai_release_frame(ai_ctl->ai_dev, ai_ctl->ai_chn, &frame, &aec_frm);