This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请问DM8168的dvr_rdk中的mcfw_demo例程中实现了音频的采集与输出了吗?

我看电路音频的采集和输出都接在了TVL320AIC3101芯片上

例程中demo.c和Demo_vcap_venc_vdec_vdis.c中都有audio采集的代码

这是demo.c中的部分代码 

513行

int Demo_startStop(int demoId, Bool startDemo)   
{
    if (gDemo_info.audioInitialized == TRUE)
    {
        Demo_startStopAudioEncodeDecode(demoId, gDemo_info.audioType, FALSE);
    }

    if(startDemo)
      ......

这是Demo_startStopAudioEncodeDecode()函数的的具体实现

Int32 Demo_startStopAudioEncodeDecode (Int32 demoId, Int32 option, Bool userOpt)
{
    if (gDemo_info.audioInitialized == FALSE)
    {
        Demo_initAudioSystem();
        gDemo_info.audioInitialized = TRUE;
    }

    if ((Demo_IsCaptureActive() == FALSE) &&
            (Demo_IsEncodeActive() == FALSE) &&
            (Demo_IsDecodeActive() == FALSE))
    {
        gDemo_info.audioType = DEMO_AUDIO_TYPE_NONE;
        /* Forced stop & nothing is active */
        if (userOpt == FALSE)
            option = DEMO_AUDIO_TYPE_NONE;
    }

    if ((demoId != DEMO_VDEC_VDIS) && (demoId < DEMO_LAST))
    {
        switch (option)
        {
            case DEMO_AUDIO_TYPE_CAPTURE:
                if (gDemo_info.audioType == DEMO_AUDIO_TYPE_NONE)
                {
                    if (Demo_startAudioCaptureSystem() == TRUE)
                        gDemo_info.audioType = DEMO_AUDIO_TYPE_CAPTURE;
                }
                else if (gDemo_info.audioType == DEMO_AUDIO_TYPE_CAPTURE)
......

这是Demo_vcap_venc_vdec_vdis.c文件中的部分代码

int Demo_startAudio(int demoId)
{
    audioEnabled = FALSE;
#ifndef SYSTEM_DISABLE_AUDIO
#ifndef TI8107_BCH_120_DVR
    if (DEMO_HYBRIDDVR_16CH != demoId)
    {
        char ch;

        printf("\r\n\n AUDIO: Do you enable Audio <Y/N>: ");
        ch = Demo_getChar();
        if (ch == 'y' || ch == 'Y')
        {
            audioEnabled = TRUE;
            printf ("\r\n\n\n\n -------- Starting Audio Capture ----------\n\n");
            Demo_startStopAudioEncodeDecode(demoId, DEMO_AUDIO_TYPE_CAPTURE, TRUE);
        }
    }
#endif
#endif
    return 0;
}

我尝试修改 gDemo_info.audioType 值的类型,想让采集的声音立即播放出来,改成了DEMO_AUDIO_TYPE_CHANGE_PLAYBACK_CHANNEL,但是没有声音输出,这个参数是完成这个采集立即播放的功能吗?(看字面意思感觉好像是,但就是没有声音输出)

如果我想把采集的声音存储起来,是不是需要先DEMO_AUDIO_TYPE_CAPTURE,然后编码DEMO_AUDIO_TYPE_ENCODE存储,再解码DEMO_AUDIO_TYPE_DECODE输出呢?

现在是想先让它有声音,看下效果,谢谢了,请大家多多指点~不胜感激~