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

📄 audiosrc.c

📁 是关于MTK声音的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (len > MAX_RING_COMPOSE_LEN)
    {
        return;
    }
    iMelodyPlayReq = OslConstructDataPtr(sizeof(mmi_eq_play_ext_imelody_req_struct));
    memcpy(iMelodyPlayReq->imelody, string, len);
    iMelodyPlayReq->len = len;
    iMelodyPlayReq->play_style = style;
    Message.oslMsgId = PRT_EQ_PLAY_EXT_IMELODY_REQ;
    Message.oslDataPtr = (oslParaType*) iMelodyPlayReq;
    Message.oslPeerBuffPtr = NULL;
    Message.oslSrcId = MOD_MMI;
    Message.oslDestId = MOD_L4C;
    OslMsgSendExtQueue(&Message);
}


/*****************************************************************************
 * FUNCTION
 *  AudioPlayIMelodyFile
 * DESCRIPTION
 *  
 * PARAMETERS
 *  file        [?]         
 *  style       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void AudioPlayIMelodyFile(U8 *file, U8 style)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (file)   /* !=NULL */
    {
    #if 1
        mdi_audio_play_file(file, style, NULL, NULL);
    #else /* 1 */ 
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
    #endif /* 1 */ 
    }
}


/*****************************************************************************
 * FUNCTION
 *  AudioPlayIMelodyFileWithId
 * DESCRIPTION
 *  
 * PARAMETERS
 *  file        [?]         
 *  style       [IN]        
 *  nId         [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void AudioPlayIMelodyFileWithId(U8 *file, U8 style, U16 nId)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (file)   /* !=NULL */
    {
        MYQUEUE Message;
        mmi_eq_play_audio_by_name_req_struct *audioByNamePlayReq;

        if (pfnUnicodeStrlen((PS8) file) > MAX_MELODY_FILE_NAME)
        {
            return;
        }
        audioByNamePlayReq = OslConstructDataPtr(sizeof(mmi_eq_play_audio_by_name_req_struct));
        audioByNamePlayReq->style = style,
            audioByNamePlayReq->identifier = nId,
            pfnUnicodeStrcpy((PS8) audioByNamePlayReq->file_name, (PS8) file),
            Message.oslMsgId = PRT_EQ_PLAY_AUDIO_BY_NAME_REQ;
        Message.oslDataPtr = (oslParaType*) audioByNamePlayReq;
        Message.oslPeerBuffPtr = NULL;
        Message.oslSrcId = MOD_MMI;
        Message.oslDestId = MOD_L4C;
        OslMsgSendExtQueue(&Message);
    }

}


/*****************************************************************************
 * FUNCTION
 *  AudioStopIMelodyFile
 * DESCRIPTION
 *  
 * PARAMETERS
 *  file        [?]     
 * RETURNS
 *  void
 *****************************************************************************/
void AudioStopIMelodyFile(U8 *file)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (file)
    {
    #if 1
        mdi_audio_stop_file();
    #else /* 1 */ 
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
    #endif /* 1 */ 
    }
}

// #if 0


/*****************************************************************************
 * FUNCTION
 *  PlayAudioMidiStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  audioBuffer     [?]         
 *  length          [IN]        
 *  style           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void PlayAudioMidiStream(U8 *audioBuffer, U16 length, U8 style)
{
#ifdef MMI_ON_HARDWARE_P
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 format = MEDIA_SMF;  /* AUD_MEDIA_SMF; */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PlayAudioStream(audioBuffer, length, format, style);
#endif /* MMI_ON_HARDWARE_P */ 
}


/*****************************************************************************
 * FUNCTION
 *  PlayAudioWavStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  audioBuffer     [?]         
 *  length          [IN]        
 *  style           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void PlayAudioWavStream(U8 *audioBuffer, U16 length, U8 style)
{
#ifdef MMI_ON_HARDWARE_P
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 format = MEDIA_WAV;  /* AUD_MEDIA_WAV; */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PlayAudioStream(audioBuffer, length, format, style);
#endif /* MMI_ON_HARDWARE_P */ 
}


/*****************************************************************************
 * FUNCTION
 *  PlayAudioDviStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  audioBuffer     [?]         
 *  length          [IN]        
 *  style           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void PlayAudioDviStream(U8 *audioBuffer, U16 length, U8 style)
{
#ifdef MMI_ON_HARDWARE_P
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 format = MEDIA_DVI_ADPCM;    /* AUD_MEDIA_WAV; */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PlayAudioStream(audioBuffer, length, format, style);
#endif /* MMI_ON_HARDWARE_P */ 
}


/*****************************************************************************
 * FUNCTION
 *  PlayAudioStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  audioBuffer     [?]         
 *  length          [IN]        
 *  format          [IN]        
 *  style           [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void PlayAudioStream(U8 *audioBuffer, U16 length, U8 format, U8 style)
{
#if 1
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mdi_audio_play_string((void*)audioBuffer, length, format, style, NULL, NULL);
#else /* 1 */ 
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 1 */ 
}


/*****************************************************************************
 * FUNCTION
 *  StopAudioMidiStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StopAudioMidiStream(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    StopAudioStream();
}


/*****************************************************************************
 * FUNCTION
 *  StopAudioWavStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StopAudioWavStream(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    StopAudioStream();
}


/*****************************************************************************
 * FUNCTION
 *  StopAudioDviStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StopAudioDviStream(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    StopAudioStream();
}


/*****************************************************************************
 * FUNCTION
 *  StopAudioStream
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StopAudioStream(void)
{
#if 1
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mdi_audio_stop_string();
#else /* 1 */ 
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 1 */ 
}

// #endif

⌨️ 快捷键说明

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