return MEDIA_OK;\r
}\r
\r
+bool AudioPlayerService::HasM3U8(const std::string& str)\r
+{\r
+ size_t pos = str.find(".m3u8");\r
+ return pos != std::string::npos;\r
+}\r
+\r
int32_t AudioPlayerService::Start(void)\r
{\r
if (currentState_ != AudioPlayerStates::AUDIO_PLAYER_IDLE) {\r
ResetAudioPlayState();\r
currentState_ = AudioPlayerStates::AUDIO_PLAYER_ENTERED;\r
MediaThreadattr attr = { "AudioPlayThread", 0x1800, THREAD_SCHED_INVALID, 0, true };\r
+ if (HasM3U8(playList_.at(playIndex_))) {\r
+ attr.stackSize = 0x9000;\r
+ }\r
threadHandle_ = MediaThreadCreate(AudioPlayThread, this, &attr);\r
if (threadHandle_ == nullptr) {\r
MEDIA_ERR_LOG("create thread failed");\r
MEDIA_ERR_LOG("src is nullptr!");\r
return;\r
}\r
+ if (strncmp(src, "http", 4) == 0) { // 4 means lenth of string "http"\r
+ MEDIA_ERR_LOG("GetAlbumInfo unsupport http play");\r
+ return;\r
+ }\r
if (albumInfoPlayer_ == nullptr) {\r
albumInfoPlayer_= std::make_shared<Player>();\r
}\r
{
MediaInitStaticMutexLock(&g_voiceCallVolteContextMutex);
MediaMutexLock(g_voiceCallVolteContextMutex);
- int32_t type = strtol(param[0x1], nullptr, NUMBER_BASE);
+ int32_t type = 0;//strtol(param[0x1], nullptr, NUMBER_BASE);
if (g_voiceCallVolteContext != nullptr) {
MEDIA_ERR_LOG("invalid operation");
MediaMutexUnLock(g_voiceCallVolteContextMutex);
MEDIA_ERR_LOG("not support set sae enable!");
return -1;
}
- int32_t enable = strtol(param[0x1], nullptr, NUMBER_BASE);
+ int32_t enable = 1;//strtol(param[0x1], nullptr, NUMBER_BASE);
+ MEDIA_ERR_LOG("enable %d",enable);
int32_t ret = 0;
if (enable == 0) {
ret = AudioManagerSetSeaEnable(false);
attr->name, attrBits, nullptr, 0, nullptr, attr->stackSize, osPriorityNormal, 0, 0
};
if (strcmp(attr->name, "AudioPlayThread") == 0) {
- taskAttr.stack_mem = memalign(16, attr->stackSize); // 16×Ö½Ú¶ÔÆë£¬ÉêÇëÄÚ´æµ½psram
+ taskAttr.stack_mem = memalign(16, attr->stackSize); // 16字节对齐,申请内存到psram
member->stackMem = taskAttr.stack_mem;
}
MediaSetCmsisThreadPriorityAttr(taskAttr, attr->prioty);
return ret;
}
uapi_ai_gain gain = {};
- gain.integer = DEFAULTE_AI_VOL_DB_INTERGER;
+ // gain.integer = DEFAULTE_AI_VOL_DB_INTERGER;
+ gain.integer = gain.integer + 10; // 前端mic灵敏度不同可通过此处调增,增加4db增益 默认gain.integer = gain.integer+4
gain.decimal = 0;
MEDIA_HAL_LOGI(MODULE_NAME, "set default AI volume.integer = %d, decimal = %d", gain.integer, gain.decimal);
MEDIA_HAL_DOFUNC_TIME(ret = uapi_ai_set_volume(*aiHandle, &gain));