📄 aud_interface.c
字号:
#ifdef __cplusplusextern "C" {#endif/*================================================================================================== Module Name: aud_interface.c General Description: Prototypes for audio interface==================================================================================================== Motorola Confidential Proprietary Advanced Technology and Software Operations (c) Copyright Motorola 1999-2001 All Rights Reserved Revision History: Date Author Reference ======== ======== ================ 2004-11-05 w17860 LIBff24932 P4.4 Feature # 12583 Memory Reduction - Remove Voice Dial and Voice Tag Modification TrackingAuthor Date Number Description of Changes------------------------- ------------ ---------- -------------------------------------------Jonathan Akers 07/15/2005 LIBgg49853 Change ISR to handle getting audio samples from HAPIJonathan Akers 11/23/2004 libff38547 VST VR PortMark Kroboth 07/08/2003 LIBdd14922 Fix for shutdown of VST VR during phonecall/pageMark Kroboth 07/01/2003 LIBdd14400 Send stop confirmation to VST VR SP immediately if in IDLE state.Arthur Aaron 06/13/2003 LIBdd01040 Flushed out 5 new audio interface commands for VST VRNicholas Chiarulli 05/01/2003 LIBdd01040 Modify Audio Manager to accept VST VR port from CDMA T730 Lori Lareau 02/23/2004 LIBdd72710 WAV UI soundsRavi Subramanyan 04/28/2003 LIBdd02287 Turn off Noise Suppression when Network requests it for AMR Lori Haegele 09/24/2002 LIBbb50981 TCMD use of audio mdi queueChris Fries 07/17/2002 LIBbb43909 Volume keys cause voice to muteLori Haegele 06/11/2002 LIBbb25413 Set Stereo DAC sampling rateMark Taraba 03/15/2001 CSGce90543 AM is sending CTG_ON command unnecessarily resulting in VR hangupMark Taraba 12/08/2000 CSGce82641 Add Audio/HAPI interface for current DAI mode.mtaraba 12/21/2000 CSGce82934 main_comp_hardware.h within engine_audio vob should be removedChris Fries 11/09/2000 CSGce79507 Add interface for engine to abort vr Mark Taraba 09/11/2000 CSGce68318 Add audio manager support for customer audio loopback testingSteve Hagino 08/03/2000 CSGce67731 Make Audio Manager Ansi-CompliantSteve Hagino 03/21/2000 CSGce51678 - Updated as a result of inspection. am_status() implemented.Steve Hagino 03/14/2000 CSGce51678 Added functions for Power Up/Down Bill Choi 12/05/1999 CSGce39558 adding functional support for VA and VR.Mark Taraba 11/08/1999 CSGce42083 Phase 4/5 Interface Functions - Initial file creationPortability: Indicate if this module is portable to other compilers or platforms. If not, indicate specific reasons why is it not portable.==================================================================================================== INCLUDE FILES==================================================================================================*/#include <string.h>#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#include <ENGINE_AUDIO/aud_interface.h>#include <audio/am_server_task.h>#include <ENGINE_HAPI/hapi_mdi_message_ids.h>#include <SUAPI/suapi.h>#include <audio/am_va_vr_command_types.h>#include <audio/aud_tone_req.h>#include <audio/am_globals.h>#include <ENGINE_AUDIO/audio_dai.h>#include <SYNERGY_DEVICE_LAYER/dl_ports.h>#include <SYNERGY_DEVICE_LAYER/dl_media_auf.h>#include <SYNERGY_DEVICE_LAYER/dl_file_system_auf.h>/*================================================================================================== LOCAL FUNCTION PROTOTYPES==================================================================================================*//*================================================================================================== LOCAL CONSTANTS==================================================================================================*//*================================================================================================== LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)==================================================================================================*//*================================================================================================== LOCAL MACROS==================================================================================================*//*================================================================================================== LOCAL VARIABLES==================================================================================================*//* This tells if the VR is exclusively using the DSP, no calls can be made */BOOL is_vr_active = FALSE;extern SU_SEMA_HANDLE sem_low_power;/* This tells the audio engine that the volume application is active, so don't mute the uplink speech */BOOL is_volume_app_active = FALSE;/*================================================================================================== GLOBAL VARIABLES==================================================================================================*/extern BOOL am_suspend;BOOL replies_to_tcmd;// Default settings for VST audio parameters at power up AUD_VST_PARAMS_T audVstParams ={ AUD_VST_IDLE, // Current VST activity occuring in AM NULL, // Pointer containing the address of the audio data buffer 0, // Size of the audio data buffer 0, // number of frames in capture period FALSE, // BOOL describing whether a tone should be played before starting audio capture 0, // current frame count of capture session FALSE, // whether the audio command request needs to wait for the end of an on-going tone FALSE // TRUE if AM is aborting playback or recording.};/*================================================================================================== LOCAL FUNCTIONS==================================================================================================*//*================================================================================================== GLOBAL FUNCTIONS==================================================================================================*/#if (MAKE_FTR_VA == TRUE)void aud_va_command_req( TD_VA_COMMAND command, UINT8 voicenote_number, TD_VA_GROUP_TYPE type){ AUD_VA_COMMAND_REQ *msgptr = NULL; msgptr = (AUD_VA_COMMAND_REQ *) suCreateMessage((UINT32)sizeof(AUD_VA_COMMAND_REQ), (UINT32)AUD_VA_COMMAND_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->command = command; msgptr->voicenote_number = voicenote_number; msgptr->type = type; AM_SendMessage((char *)msgptr); }#endif#if (MAKE_FTR_VR == TRUE)/*--------------------------------------------------------------------------- * DESCRIPTION: * Create and build a AUD_Play_Voice_Tag_Req primitive and send it to * Audio Manager. */void aud_sdvr_play_voice_tag_req( UINT16 voice_tag_count, TD_VR_VOICE_TAG *voice_tag_array ){ AUD_PLAY_VOICE_TAG_REQ * msgptr = NULL; msgptr = (AUD_PLAY_VOICE_TAG_REQ *) suCreateMessage((UINT32)sizeof(AUD_PLAY_VOICE_TAG_REQ), (UINT32)AUD_PLAY_VOICE_TAG_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->voice_tag_count = voice_tag_count; memcpy( msgptr->voice_tag_array, voice_tag_array, sizeof( TD_VR_VOICE_TAG ) * voice_tag_count ); AM_SendMessage((char *)msgptr); }void aud_sdvr_enable(){ char * msgptr = NULL; msgptr =suCreateMessage((UINT32)0,(UINT32)AUD_VR_ENABLE_ID, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *)msgptr); }void aud_sdvr_disable(){ char *msgptr = NULL; msgptr = suCreateMessage((UINT32)0,(UINT32)AUD_VR_DISABLE_ID, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *)msgptr); }void aud_sdvr_capture_req( UINT16 repetition, UINT16 time, TD_VR_GROUP_TYPE group_id ){ AUD_SDVR_CAPTURE_REQ * msgptr = NULL; msgptr = (AUD_SDVR_CAPTURE_REQ*) suCreateMessage((UINT32)sizeof(AUD_SDVR_CAPTURE_REQ), (UINT32)AUD_SDVR_CAPTURE_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->repetition = repetition; msgptr->time = time; msgptr->group_id = group_id; is_vr_active = TRUE; AM_SendMessage((char *)msgptr); }void aud_sdvr_delete_req(TD_VR_VOICE_TAG voice_tag){ AUD_SDVR_DELETE_VOICE_TAG_REQ * msgptr = NULL; msgptr = (AUD_SDVR_DELETE_VOICE_TAG_REQ*)suCreateMessage((UINT32)sizeof(AUD_SDVR_DELETE_VOICE_TAG_REQ), (UINT32)AUD_SDVR_DELETE_VOICE_TAG_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->voice_tag = voice_tag; AM_SendMessage((char *)msgptr);}void aud_sdvr_model_id_req(TD_VR_GROUP_TYPE group_id){ AUD_SDVR_MODEL_ID_REQ* msgptr = NULL; msgptr = (AUD_SDVR_MODEL_ID_REQ*) suCreateMessage((UINT32)sizeof(AUD_SDVR_MODEL_ID_REQ), (UINT32)AUD_SDVR_MODEL_ID_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->group_id = group_id; AM_SendMessage((char *)msgptr);}void aud_sdvr_start_req(TD_VR_GROUP_TYPE group_id, BOOL repeat_indication, UINT8 nbest, UINT8 active_bit_array_size, UINT16 *active_bit_array, UINT16 time){ AUD_SDVR_START_REQ * msgptr = NULL; msgptr = (AUD_SDVR_START_REQ*) suCreateMessage((UINT32)sizeof(AUD_SDVR_START_REQ), (UINT32)AUD_SDVR_START_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->group_id = group_id; msgptr->repeat_indication = repeat_indication; msgptr->nbest = nbest; msgptr->active_bit_array_size = active_bit_array_size; msgptr->time = time; is_vr_active = TRUE; memcpy( msgptr->active_bit_array, active_bit_array, sizeof( UINT16 ) * active_bit_array_size ); AM_SendMessage((char *)msgptr);}void aud_sdvr_train_req(TD_VR_GROUP_TYPE group_id, TD_VR_TRAINING_TYPE training_mode, UINT16 repetition_bit_mask){ AUD_SDVR_TRAIN_REQ * msgptr = NULL; msgptr = (AUD_SDVR_TRAIN_REQ*) suCreateMessage((UINT32)sizeof(AUD_SDVR_TRAIN_REQ), (UINT32)AUD_SDVR_TRAIN_REQ_ID, SU_INVALID_HANDLE, NULL); msgptr->group_id = group_id; msgptr->training_mode = training_mode; msgptr->repetition_bit_mask = repetition_bit_mask; AM_SendMessage((char *)msgptr);}void aud_sdvr_stop_req( void ){ char * msgptr = suCreateMessage((UINT32)0, (UINT32)AUD_VR_STOP_REQ_ID, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *)msgptr);}#endif#if (MAKE_FTR_VA == TRUE)/*=====================Interface for Interrupt routines VA/VR ========================*/void DSP_AUDIO_VA_Record_Off_Confirm(void){ char * msgptr = suCreateMessage((UINT32)0, (UINT32)DSP_MCU_VA_RECORD_OFF_CONFIRM, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *)msgptr);}void DSP_AUDIO_VA_Playback_Off_Confirm(void){ char * msgptr = suCreateMessage((UINT32)0, (UINT32)DSP_MCU_VA_PLAYBACK_OFF_CONFIRM, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *)msgptr);}#endif#if (MAKE_FTR_VR == TRUE)void DSP_AUDIO_VR_Capture_Complete(void ){ AUDSCM_SDSR_CAPTURE_COMPLETE_IND * msgptr = suCreateMessage((UINT32)sizeof(AUDSCM_SDSR_CAPTURE_COMPLETE_IND), (UINT32)DSP_MCU_VR_SD_CAPTURE_COMPLETE, SU_INVALID_HANDLE, NULL);#if (AUDIO_CDMA == TRUE) L1_MODEM_API_QUEUE_read_vr_buff(DSP_MCU_AUDIO_DATA, &msgptr->error_code, 1, 0);#endif AM_SendMessage((char *)msgptr); /* hwi_mdi_cmd_handler(DSP_CMDS_VA_RECORD_OFF , NULL, NULL ); */}void DSP_AUDIO_VR_Train_Complete(){ UINT16 t_array[2]; AUDSCM_SDSR_TRAIN_COMPLETE_IND * msgptr = NULL; msgptr = suCreateMessage((UINT32)sizeof(AUDSCM_SDSR_TRAIN_COMPLETE_IND), (UINT32)DSP_MCU_VR_SD_TRAIN_COMPLETE, SU_INVALID_HANDLE, NULL);#if (AUDIO_CDMA == TRUE) L1_MODEM_API_QUEUE_read_vr_buff(DSP_MCU_AUDIO_DATA, t_array, 2, 0);#endif msgptr->warning_code = 0; msgptr->error_code = t_array[0]; msgptr->model_id = t_array[1]; AM_SendMessage((char *) msgptr);} void DSP_AUDIO_VR_Enable_Complete(){ void *msgptr = NULL; is_vr_active = TRUE; msgptr = suCreateMessage((UINT32)0, (UINT32)AUDSCM_SDSR_ENABLE_COMPLETE_IND_ID, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *) msgptr);} void DSP_AUDIO_VR_Disable_Complete(){ void *msgptr = NULL; is_vr_active = FALSE; msgptr = suCreateMessage((UINT32)0, (UINT32)AUDSCM_SDSR_DISABLE_COMPLETE_IND_ID, SU_INVALID_HANDLE, NULL); AM_SendMessage((char *) msgptr);} void DSP_AUDIO_VR_Recognize_Complete(){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -