status_t SpeechEnhancementController::SetWBSpeechParametersToAllModem(const AUDIO_CUSTOM_WB_PARAM_STRUCT *pSphParamWB) { SpeechDriverFactory *pSpeechDriverFactory = SpeechDriverFactory::GetInstance(); SpeechDriverInterface *pSpeechDriver = NULL; for (int modem_index = MODEM_1; modem_index < NUM_MODEM; modem_index++) { pSpeechDriver = pSpeechDriverFactory->GetSpeechDriverByIndex((modem_index_t)modem_index); if (pSpeechDriver != NULL) { // Might be single talk and some speech driver is NULL pSpeechDriver->SetWBSpeechParameters(pSphParamWB); } } return NO_ERROR; }
status_t SpeechEnhancementController::SetWBSpeechParametersToAllModem(const AUDIO_CUSTOM_WB_PARAM_STRUCT *pSphParamWB) { SpeechDriverFactory *pSpeechDriverFactory = SpeechDriverFactory::GetInstance(); SpeechDriverInterface *pSpeechDriver = NULL; AUDIO_CUSTOM_WB_PARAM_STRUCT mSphParamWB; if (mSMNROn == true) { //forcely set single mic setting ALOGD("%s(), mSMNROn = %d, set single mic setting", __FUNCTION__, mSMNROn); memcpy(&mSphParamWB, pSphParamWB, sizeof(AUDIO_CUSTOM_WB_PARAM_STRUCT)); for (int speech_mode_index = 0; speech_mode_index < 8; speech_mode_index++) { (mSphParamWB.speech_mode_wb_para[speech_mode_index][13]) = 0; (mSphParamWB.speech_mode_wb_para[speech_mode_index][14]) = 0; } } for (int modem_index = MODEM_1; modem_index < NUM_MODEM; modem_index++) { pSpeechDriver = pSpeechDriverFactory->GetSpeechDriverByIndex((modem_index_t)modem_index); if (pSpeechDriver != NULL) // Might be single talk and some speech driver is NULL { if (mSMNROn != true) { pSpeechDriver->SetWBSpeechParameters(pSphParamWB); } else { pSpeechDriver->SetWBSpeechParameters(&mSphParamWB); } } } return NO_ERROR; }