ai noise button support
This commit is contained in:
@@ -267,6 +267,7 @@ unsigned g_windows_detect_done = 0;
|
|||||||
extern unsigned g_host_os; // 1 -> Windows, 2 -> Others
|
extern unsigned g_host_os; // 1 -> Windows, 2 -> Others
|
||||||
extern unsigned g_mute_on_off_t0;
|
extern unsigned g_mute_on_off_t0;
|
||||||
extern unsigned g_uac_vol;
|
extern unsigned g_uac_vol;
|
||||||
|
extern void dnr_set_mode(unsigned char mode);
|
||||||
|
|
||||||
extern void device_reboot(void);
|
extern void device_reboot(void);
|
||||||
|
|
||||||
@@ -843,19 +844,21 @@ void button_task(chanend c_hidSendData, chanend cc_mic_level, chanend c_uac_vol)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
push_button_aidenoise_onoff_state_old = button_aidenoise_onoff;
|
push_button_aidenoise_onoff_state_old = button_aidenoise_onoff;
|
||||||
|
#if DNR_ENABLE == 1
|
||||||
if(mode_change)
|
if(mode_change)
|
||||||
if(flag_aidenoise_onoff)
|
if(flag_aidenoise_onoff)
|
||||||
{
|
{
|
||||||
led_on(&led_ctx, LED_ANC);
|
led_on(&led_ctx, LED_ANC);
|
||||||
|
dnr_set_mode(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
led_off(&led_ctx, LED_ANC);
|
led_off(&led_ctx, LED_ANC);
|
||||||
|
dnr_set_mode(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//led_update_all(&led_ctx);
|
//led_update_all(&led_ctx);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mode_change = 0;
|
mode_change = 0;
|
||||||
|
|||||||
@@ -86,12 +86,19 @@ void Aizip_DNR_init(void)
|
|||||||
debug_printf("AI_DNR_init status %d\n", sta);
|
debug_printf("AI_DNR_init status %d\n", sta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float g_dnr_level = -200;
|
||||||
|
|
||||||
|
void dnr_set_mode(unsigned char mode)
|
||||||
|
{
|
||||||
|
if(mode == 0)
|
||||||
|
g_dnr_level = 0;
|
||||||
|
else
|
||||||
|
g_dnr_level = -200;
|
||||||
|
}
|
||||||
|
|
||||||
void start_dsp_processing(void)
|
void start_dsp_processing(void)
|
||||||
{
|
{
|
||||||
float level = -200;
|
setNoisy_mix_factor(g_dnr_level);
|
||||||
|
|
||||||
setNoisy_mix_factor(level);
|
|
||||||
|
|
||||||
AI_DNR_Processing((int32_t *)&dsp_dnr_frame_buf[processing_buf_slot][0][0]);
|
AI_DNR_Processing((int32_t *)&dsp_dnr_frame_buf[processing_buf_slot][0][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user