AI_ForceInterrupt();
do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_DEINIT, NULL, 0);
- // 2. 设置常亮屏
- ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
-
- // 3. 跳转到对话说话界面
+ // 2. 跳转到对话说话界面
if (ThunderBirdMainView::GetInstance()) {
int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING);
}
- int32_t uiVolume = get_ui_volume();
- if (uiVolume <= 0 || uiVolume > 100) {
- uiVolume = 50; // 默认音量50%
- }
- AudioServiceSetVolume(AUDIO_STREAM_ALARM_CLOCK, uiVolume);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleJumpDialogueSpeaking: Set ALARM_CLOCK volume to %d%%", uiVolume);
+ // 3. 设置常亮屏
+ ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
- // 5. 循环播放 FactoryMode.mp3(使用 ln_audio_simple_play_loop,支持循环播放,无需线程)
+ // 4. 循环播放 FactoryMode.mp3(使用 ln_audio_simple_play_loop,支持循环播放,无需线程)
+ // 音量由按键直接控制(AUDIO_STREAM_VOICE_ASSISTANT),无需手动设置
const char *factory_mode_file = "/user/res/music/FactoryMode.mp3";
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleJumpDialogueSpeaking: Playing file: %s (will loop)", factory_mode_file);
// 异步执行,避免阻塞按键处理
AudioManager::GetInstance().SetVolume(AUDIO_STREAM_VOICE_ASSISTANT, volumeToApply);
+ AudioManager::GetInstance().SetVolume(AUDIO_STREAM_ALARM_CLOCK, volumeToApply);
ln_bt_earphone_set_volume(volumeToApply);
// 更新Model中的音量值
ThunderBirdModel::GetInstance()->m_volume = volumeToApply;
} else {
// 同步执行
AudioManager::GetInstance().SetVolume(AUDIO_STREAM_VOICE_ASSISTANT, volumeToApply);
+ AudioManager::GetInstance().SetVolume(AUDIO_STREAM_ALARM_CLOCK, volumeToApply);
ln_bt_earphone_set_volume(volumeToApply);
// 更新Model中的音量值
ThunderBirdModel::GetInstance()->m_volume = volumeToApply;