GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
ifeq ($(CFG_XMEDIA_EXPORT_FLAG),)
|
||||
SDK_DIR := $(shell cd $(CURDIR)/../../.. && /bin/pwd)
|
||||
endif
|
||||
|
||||
include $(SDK_DIR)/build/base.mk
|
||||
include $(SAMPLE_DIR)/sample_base.mk
|
||||
|
||||
LIBS := $(SAMPLE_LIBS) $(SAMPLE_COMMON_LIB)
|
||||
|
||||
INCLUDES += -I$(SDK_DIR)/sample/common
|
||||
INCLUDES += -I$(SDK_DIR)/source/gmp/include
|
||||
|
||||
SDK_USR_CFLAGS += $(SAMPLE_CFLAGS) $(LIBS) $(INCLUDES)
|
||||
|
||||
sample_audio_target = aq_utils_test_speaker_vol \
|
||||
aq_utils_test_mic_vol \
|
||||
aq_utils_test_record \
|
||||
aq_utils_test_talk \
|
||||
aq_utils_test_aiao \
|
||||
aq_utils_test_detect
|
||||
|
||||
SAMPLE_AUDIDO_COMMON_SRCS := $(wildcard ./config_parameter/*.c)
|
||||
SAMPLE_AUDIDO_COMMON_OBJS := $(patsubst %.c, %.o, $(SAMPLE_AUDIDO_COMMON_SRCS))
|
||||
|
||||
.PHONY: all clean $(SAMPLE_AUDIDO_COMMON_OBJS)
|
||||
|
||||
all : $(sample_audio_target) $(SAMPLE_AUDIDO_COMMON_OBJS)
|
||||
|
||||
$(SAMPLE_AUDIDO_COMMON_OBJS): $(SAMPLE_AUDIDO_COMMON_SRCS)
|
||||
$(AT)$(CONFIG_XMEDIA_USR_ARM_TOOLCHAINS)-gcc -c $< -o $@ $(SDK_USR_CFLAGS)
|
||||
|
||||
$(sample_audio_target): %: %.o $(SAMPLE_AUDIDO_COMMON_OBJS)
|
||||
$(AT)$(CONFIG_XMEDIA_USR_ARM_TOOLCHAINS)-gcc -o $@ $(SAMPLE_AUDIDO_COMMON_OBJS) $< $(SDK_USR_CFLAGS)
|
||||
|
||||
%.o : %.c
|
||||
$(AT)$(CONFIG_XMEDIA_USR_ARM_TOOLCHAINS)-gcc -c $< $(SDK_USR_CFLAGS)
|
||||
|
||||
clean :
|
||||
$(AT)rm -rf $(sample_audio_target) *.o $(SAMPLE_AUDIDO_COMMON_OBJS)
|
||||
Executable
+315
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
//#include "sample_comm.h"
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_enhance_v1.h"
|
||||
#include "xmedia_audio_vqe_enhance_v2.h"
|
||||
#include "sample_comm_audio.h"
|
||||
#include "config_parameter/config_load_parameter.h"
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define MAX_FILE_NAME_LEN 128
|
||||
#define FRAME_TIME 10 //ms
|
||||
#define DEFAULT_AI_FRAME_NUM 50
|
||||
|
||||
typedef struct user_input_args {
|
||||
xmedia_char* sample;
|
||||
audio_sample_rate sample_rate;
|
||||
audio_sample_rate usr_sample_rate;
|
||||
audio_channel channels;
|
||||
xmedia_bool binder_mode;
|
||||
audio_sample_rate file_samplerate;
|
||||
|
||||
char input_file_name[MAX_FILE_NAME_LEN];
|
||||
char output_file_name[MAX_FILE_NAME_LEN];
|
||||
FILE *input_fd[2];
|
||||
FILE *output_fd[2];
|
||||
} user_input_args;
|
||||
|
||||
static user_input_args g_user_input_args;
|
||||
static sample_ai_config g_ai_config;
|
||||
static sample_ao_config g_ao_config;
|
||||
static xmedia_s32 g_codec_vol;
|
||||
static xmedia_s32 g_ao_vol;
|
||||
|
||||
static xmedia_s32 sample_ai_config_init(xmedia_void)
|
||||
{
|
||||
g_ai_config.dev = XMEDIA_AI_DEV_ADC0;
|
||||
sample_comm_ai_get_default_attr(g_ai_config.dev, &g_ai_config.dev_attr);
|
||||
g_ai_config.dev_attr.channels = g_user_input_args.channels;
|
||||
g_ai_config.dev_attr.sample_rate = g_user_input_args.sample_rate;
|
||||
g_ai_config.dev_attr.pcm_samples_per_frame = g_user_input_args.sample_rate / 100;
|
||||
g_ai_config.dev_attr.pcm_frame_num = DEFAULT_AI_FRAME_NUM;
|
||||
g_ai_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
g_ai_config.chn_attr.sample_rate = g_user_input_args.sample_rate;
|
||||
g_ai_config.chn_attr.interleaved = XMEDIA_TRUE;
|
||||
g_ai_config.source = AI_EC_SOURCE_AO_DAC0;
|
||||
g_ai_config.ec_chn_id = 0;
|
||||
g_ai_config.vqe_enable = XMEDIA_FALSE;
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_ao_config_init(xmedia_void)
|
||||
{
|
||||
g_ao_config.dev = XMEDIA_AO_DEV_DAC0;
|
||||
|
||||
sample_comm_ao_get_default_attr(g_ao_config.dev, &g_ao_config.dev_attr);
|
||||
g_ao_config.dev_attr.channels = g_user_input_args.channels;
|
||||
g_ao_config.dev_attr.sample_rate = g_user_input_args.sample_rate;
|
||||
g_ao_config.dev_attr.pcm_samples_per_frame = g_user_input_args.sample_rate / 100;
|
||||
g_ao_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
g_ao_config.vqe_enable = XMEDIA_FALSE;
|
||||
|
||||
g_ao_config.frame_info.frm_rate = g_user_input_args.sample_rate;
|
||||
g_ao_config.frame_info.frm_chn = g_user_input_args.channels;
|
||||
g_ao_config.frame_info.frm_bit = AUDIO_BIT_DEPTH_16;
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_init_audio()
|
||||
{
|
||||
return sample_comm_audio_init();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ai_config_init();
|
||||
CHECK_RET(ret, "sample_ai_config_init");
|
||||
|
||||
ret = sample_comm_ai_start(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_start");
|
||||
|
||||
ret = sample_comm_ai_create_output_thread_to_file(&g_ai_config, g_user_input_args.output_fd);
|
||||
CHECK_RET(ret, "sample_comm_ai_create_output_thread_to_file");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ao()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ao_config_init();
|
||||
CHECK_RET(ret, "sample_ao_config_init");
|
||||
|
||||
ret = sample_comm_ao_start(&g_ao_config);
|
||||
|
||||
sample_comm_ao_create_input_thread_from_file(&g_ao_config, g_user_input_args.input_fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_deinit_audio()
|
||||
{
|
||||
return sample_comm_audio_exit();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
ret = sample_comm_ai_destroy_output_thread_to_file(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_destroy_data_thread");
|
||||
|
||||
ret = sample_comm_ai_stop(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ao()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
ret = sample_comm_ao_destroy_input_thread_from_file(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_create_input_thread_from_file");
|
||||
|
||||
ret = sample_comm_ao_stop(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_audio_aiao(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_init_audio();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_INIT_AUDIO;
|
||||
}
|
||||
|
||||
ret = sample_start_ao();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AO;
|
||||
}
|
||||
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, g_ao_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AO;
|
||||
}
|
||||
|
||||
ret = sample_start_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AI;
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&g_codec_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_SET_GAIN;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
int val;
|
||||
xmedia_char input_cmd[32];
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'sivXX' to set input vol to xx dB\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'giv' to get input vol\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'sovXX' to set ao vqe vol to xx\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'gov' to get ao vqe vol to xx\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'i' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nSet codec input volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'i' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_GET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nGet codec input volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 's' && input_cmd[1] == 'o' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, val);
|
||||
SAMPLE_AUDIO_DBG("\nSet ao vqe volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'o' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ao_get_volume(&g_ao_config, &val);
|
||||
SAMPLE_AUDIO_DBG("\nGet ao vqe volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
ERR_SET_GAIN:
|
||||
sample_stop_ai();
|
||||
ERR_START_AI:
|
||||
sample_stop_ao();
|
||||
ERR_START_AO:
|
||||
ERR_INIT_AUDIO:
|
||||
sample_deinit_audio();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_usage(user_input_args* args)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_aiao [Samplerate] [Channel] [CodecInputVol] [AoVol] [MicFile] [SpkFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" [Samplerate]: Work Samplerate, 8000 or 16000 \n");
|
||||
SAMPLE_AUDIO_DBG(" [Channel]: dev chn, 1 or 2 \n");
|
||||
SAMPLE_AUDIO_DBG(" [CodecInputVol]: audiocodec mic input volume, range:[-95~48] \n");
|
||||
SAMPLE_AUDIO_DBG(" [AoVol]: ao vqe volume, range:[-81~18] \n");
|
||||
SAMPLE_AUDIO_DBG(" [MicFile]: file for saving mic data\n");
|
||||
SAMPLE_AUDIO_DBG(" [SpkFile]: file for speaker playback\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_aiao 16000 1 20 0 /tmp/mic.pcm /tmp/test_signal_loopback_16k_1ch_16bit.pcm\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_aiao 8000 2 20 0 /tmp/mic.pcm /tmp/test_signal_loopback_8k_1ch_16bit.pcm\n");
|
||||
}
|
||||
|
||||
static xmedia_s32 user_args_init(int argc, char* argv[], user_input_args* user_in_args)
|
||||
{
|
||||
user_in_args->sample = argv[0];
|
||||
|
||||
if ((argc >= 2) && (strcmp(argv[1], "-h")) == 0) {
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (argc != 7) {
|
||||
SAMPLE_AUDIO_DBG("Invalid argc:%d\n", argc);
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
user_in_args->sample_rate = atoi(argv[1]);
|
||||
user_in_args->channels = atoi(argv[2]);
|
||||
g_codec_vol = atoi(argv[3]);
|
||||
g_ao_vol = atoi(argv[4]);
|
||||
user_in_args->binder_mode = XMEDIA_TRUE;
|
||||
memcpy(user_in_args->output_file_name, argv[5], strlen(argv[5]));
|
||||
if (strcmp(user_in_args->output_file_name, "null")) {
|
||||
user_in_args->output_fd[0] = fopen(user_in_args->output_file_name, "w+");
|
||||
if (user_in_args->output_fd[0] == NULL) {
|
||||
SAMPLE_AUDIO_DBG("Open %s failed\n", user_in_args->output_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(user_in_args->input_file_name, argv[6], strlen(argv[6]));
|
||||
if (strcmp(user_in_args->input_file_name, "null")) {
|
||||
user_in_args->input_fd[0] = fopen(user_in_args->input_file_name, "rb");
|
||||
if (user_in_args->input_fd[0] == NULL) {
|
||||
SAMPLE_AUDIO_DBG("Open %s failed\n", user_in_args->input_file_name);
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
SAMPLE_AUDIO_DBG(" mic0_file_name:%s\n", user_in_args->output_file_name);
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_deinit(user_input_args* user_in_args)
|
||||
{
|
||||
if (user_in_args->output_fd[1] != NULL) {
|
||||
fclose(user_in_args->output_fd[1]);
|
||||
user_in_args->output_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
user_in_args->output_fd[0] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->input_fd[1] != NULL) {
|
||||
fclose(user_in_args->input_fd[1]);
|
||||
user_in_args->input_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->input_fd[0] != NULL) {
|
||||
fclose(user_in_args->input_fd[0]);
|
||||
user_in_args->input_fd[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = user_args_init(argc, argv, &g_user_input_args);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
SAMPLE_AUDIO_DBG("user_args_init failed(0x%x)\n\n", ret);
|
||||
return ret;
|
||||
}
|
||||
SAMPLE_AUDIO_DBG("user_args_init ok\n");
|
||||
|
||||
ret = sample_audio_aiao();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
SAMPLE_AUDIO_DBG("sample_auido_ai failed(0x%x)\n", ret);
|
||||
}
|
||||
|
||||
user_args_deinit(&g_user_input_args);
|
||||
SAMPLE_AUDIO_DBG("exit %s\n", g_user_input_args.sample);
|
||||
return ret;
|
||||
}
|
||||
Executable
+325
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
//#include "sample_comm.h"
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_bcd.h"
|
||||
#include "xmedia_audio_vqe_detect.h"
|
||||
|
||||
#include "sample_comm_audio.h"
|
||||
#include "config_parameter/config_load_parameter.h"
|
||||
|
||||
static ai_vqe_attr_detect detect_attr;
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define MAX_FILE_NAME_LEN 128
|
||||
#define FRAME_TIME 10 //ms
|
||||
|
||||
typedef struct user_input_args {
|
||||
xmedia_char* sample;
|
||||
audio_sample_rate sample_rate;
|
||||
audio_sample_rate usr_sample_rate;
|
||||
audio_channel channels;
|
||||
xmedia_bool binder_mode;
|
||||
xmedia_s32 codec_input_vol;
|
||||
xmedia_s32 ai_vqe_vol;
|
||||
|
||||
char output_file_name[MAX_FILE_NAME_LEN];
|
||||
char config_file_name[MAX_FILE_NAME_LEN];
|
||||
FILE *output_fd[2];
|
||||
} user_input_args;
|
||||
|
||||
static user_input_args g_user_input_args;
|
||||
static sample_ai_config g_ai_config;
|
||||
static user_base_config base_config;
|
||||
|
||||
static xmedia_s32 cry_callback(xmedia_void *attr)
|
||||
{
|
||||
static xmedia_s32 count = 0;
|
||||
printf("cry callback count(%d)\n" ,count++);
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 gbd_callback(xmedia_void *attr)
|
||||
{
|
||||
static xmedia_s32 count = 0;
|
||||
printf("gbd callback count(%d)\n" ,count++);
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 ssl_callback(xmedia_void* attr, xmedia_s32 out)
|
||||
{
|
||||
static xmedia_s32 ssl_out = 0;
|
||||
static xmedia_s32 call_times = 0;
|
||||
call_times++;
|
||||
|
||||
if (ssl_out != out) {
|
||||
printf("attr(0x%x), call_times(%d), out_angle(%d)\n", (xmedia_u32)attr, call_times, out);
|
||||
}
|
||||
ssl_out = out;
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 ved_callback(xmedia_void* private, xmedia_bool is_event, xmedia_bool is_mutation, xmedia_s32 out_db)
|
||||
{
|
||||
if (is_event) {
|
||||
printf("volume event detect out_db = %d\n",out_db);
|
||||
}
|
||||
if (is_mutation) {
|
||||
printf("volume mutation detect out_db = %d\n", out_db);
|
||||
}
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_ai_config_init(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
g_ai_config.dev = XMEDIA_AI_DEV_ADC0;
|
||||
|
||||
sample_comm_ai_get_default_attr(g_ai_config.dev, &g_ai_config.dev_attr);
|
||||
|
||||
ret = load_base_parameter(g_user_input_args.config_file_name, &base_config);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
g_user_input_args.codec_input_vol = base_config.codec_input_vol;
|
||||
g_user_input_args.ai_vqe_vol = base_config.ai_vqe_vol;
|
||||
g_ai_config.dev_attr.channels = base_config.in_chn_cnt;
|
||||
g_ai_config.dev_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.dev_attr.pcm_samples_per_frame = base_config.sample_per_frame;
|
||||
g_ai_config.dev_attr.pcm_frame_num = base_config.frame_nums;
|
||||
g_ai_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
g_ai_config.chn_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.source = AI_EC_SOURCE_AO_DAC0;
|
||||
g_ai_config.ec_chn_id = 0;
|
||||
g_ai_config.res_enable = XMEDIA_FALSE;
|
||||
g_ai_config.chn_attr.interleaved = XMEDIA_TRUE;
|
||||
if ((g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_8000 && g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_16000)
|
||||
|| (g_ai_config.chn_attr.sample_rate != g_ai_config.dev_attr.sample_rate)) {
|
||||
g_ai_config.res_enable = XMEDIA_TRUE;
|
||||
}
|
||||
|
||||
g_ai_config.vqe_enable = XMEDIA_TRUE;
|
||||
if (base_config.vqe_version == AI_VQE_DETECT_ATTR_VERSION_1) {
|
||||
g_ai_config.vqe_attr.attr = &detect_attr;
|
||||
}
|
||||
g_ai_config.vqe_attr.version = base_config.vqe_version;
|
||||
g_ai_config.vqe_attr.work_sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.vqe_attr.in_channels = base_config.in_chn_cnt;
|
||||
ret = load_aivqe_parameter(g_user_input_args.config_file_name, &g_ai_config.vqe_attr);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
detect_attr.bcd_attr.bcd_model.load_type = XMEDIA_CL_LOAD_FILE;
|
||||
detect_attr.bcd_attr.bcd_model.model_info.file.pathname = "../audio_xmm/bcd_neuron_network.xmm";
|
||||
detect_attr.bcd_attr.callback = (fn_bcd_callback)cry_callback;
|
||||
|
||||
detect_attr.gbd_attr.gbd_model.load_type = XMEDIA_CL_LOAD_FILE;
|
||||
detect_attr.gbd_attr.gbd_model.model_info.file.pathname = "../audio_xmm/gbd_neuron_network.xmm";
|
||||
detect_attr.gbd_attr.callback = (fn_detect_gbd_callback)gbd_callback;
|
||||
|
||||
detect_attr.ssl_attr.callback = (fn_detect_ssl_callback)ssl_callback;
|
||||
detect_attr.ved_attr.callback = (fn_detect_ved_callback)ved_callback;
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_init_audio()
|
||||
{
|
||||
return sample_comm_audio_init();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
xmedia_u32 mask = 0;
|
||||
|
||||
ret = sample_ai_config_init();
|
||||
CHECK_RET(ret, "sample_ai_config_init");
|
||||
mask = detect_attr.mask;
|
||||
|
||||
ret = sample_comm_ai_register(mask, g_ai_config.vqe_attr.version, g_ai_config.res_enable);
|
||||
CHECK_RET(ret, "sample_comm_ai_register");
|
||||
|
||||
ret = sample_comm_ai_start(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_start");
|
||||
|
||||
if (g_ai_config.dev == XMEDIA_AI_DEV_ADC0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&g_user_input_args.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
} else if (g_ai_config.dev == XMEDIA_AI_DEV_PDM0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_MIC_GAIN, (xmedia_void*)&g_user_input_args.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_set_volume(&g_ai_config, g_user_input_args.ai_vqe_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_volume failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
ret = sample_comm_ai_create_output_thread_to_file(&g_ai_config, g_user_input_args.output_fd);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_create_output_thread_to_file failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
ERR:
|
||||
sample_comm_ai_stop(&g_ai_config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_deinit_audio()
|
||||
{
|
||||
return sample_comm_audio_exit();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
ret = sample_comm_ai_destroy_output_thread_to_file(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_destroy_data_thread");
|
||||
ret = sample_comm_ai_stop(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xmedia_s32 sample_audio_detect_vqe(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_init_audio();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_INIT_AUDIO;
|
||||
}
|
||||
|
||||
ret = sample_start_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AI;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
int val;
|
||||
xmedia_char input_cmd[32];
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'scvXX' to set input vol to xx dB\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'gcv' to get input vol\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nSet codec input volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_GET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nGet codec input volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
sample_stop_ai();
|
||||
ERR_START_AI:
|
||||
ERR_INIT_AUDIO:
|
||||
sample_deinit_audio();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_usage(user_input_args* args)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_detect [Config] [OutFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" Config : alg parameters config file\n");
|
||||
SAMPLE_AUDIO_DBG(" OutFile : vqe out file\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_detect ./config_parameter/record_ai_detect.ini /tmp/vqe_out.pcm\n");
|
||||
}
|
||||
|
||||
static xmedia_s32 user_args_init(int argc, char* argv[], user_input_args* user_in_args)
|
||||
{
|
||||
user_in_args->sample = argv[0];
|
||||
|
||||
if ((argc >= 3) && (strcmp(argv[1], "-h")) == 0) {
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (argc != 3) {
|
||||
printf("Invalid argc:%d\n", argc);
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
user_in_args->binder_mode = XMEDIA_FALSE;
|
||||
|
||||
memcpy(user_in_args->config_file_name, argv[1], strlen(argv[1]));
|
||||
|
||||
memcpy(user_in_args->output_file_name, argv[2], strlen(argv[2]));
|
||||
user_in_args->output_fd[0] = fopen(user_in_args->output_file_name, "w+");
|
||||
if (user_in_args->output_fd[0] == NULL) {
|
||||
printf("Open %s failed\n", user_in_args->output_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
SAMPLE_AUDIO_DBG(" mic0_file_name:%s\n", user_in_args->output_file_name);
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_deinit(user_input_args* user_in_args)
|
||||
{
|
||||
if (user_in_args->output_fd[1] != NULL) {
|
||||
fclose(user_in_args->output_fd[1]);
|
||||
user_in_args->output_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
user_in_args->output_fd[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = user_args_init(argc, argv, &g_user_input_args);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("user_args_init failed(0x%x)\n\n", ret);
|
||||
return ret;
|
||||
}
|
||||
SAMPLE_AUDIO_DBG("user_args_init ok\n");
|
||||
|
||||
ret = sample_audio_detect_vqe();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_audio_record_vqev1 failed(0x%x)\n", ret);
|
||||
}
|
||||
|
||||
user_args_deinit(&g_user_input_args);
|
||||
SAMPLE_AUDIO_DBG("exit %s\n", g_user_input_args.sample);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_enhance_v1.h"
|
||||
#include "xmedia_audio_vqe_enhance_v2.h"
|
||||
|
||||
#include "sample_comm_audio.h"
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define MAX_FILE_NAME_LEN 128
|
||||
#define FRAME_TIME 10 //ms
|
||||
#define DEFAULT_AI_FRAME_NUM 50
|
||||
|
||||
typedef struct user_input_args {
|
||||
xmedia_char* sample;
|
||||
ai_dev dev;
|
||||
audio_sample_rate sample_rate;
|
||||
audio_sample_rate usr_sample_rate;
|
||||
audio_bit_depth bit_depth;
|
||||
audio_channel channels;
|
||||
xmedia_s32 workmode;
|
||||
xmedia_u32 samples_per_frm;
|
||||
xmedia_s32 codec_input_vol;
|
||||
xmedia_bool binder_mode;
|
||||
|
||||
xmedia_u32 send_object;
|
||||
ao_dev send_object_dev;
|
||||
char output_file_name[MAX_FILE_NAME_LEN];
|
||||
FILE *output_fd[2];
|
||||
} user_input_args;
|
||||
|
||||
static user_input_args g_user_input_args;
|
||||
static sample_ai_config g_ai_config;
|
||||
|
||||
static xmedia_s32 sample_ai_config_init(xmedia_void)
|
||||
{
|
||||
g_ai_config.dev = g_user_input_args.dev;
|
||||
|
||||
sample_comm_ai_get_default_attr(g_ai_config.dev, &g_ai_config.dev_attr);
|
||||
g_ai_config.dev_attr.channels = g_user_input_args.channels;
|
||||
g_ai_config.dev_attr.sample_rate = g_user_input_args.sample_rate;
|
||||
g_ai_config.dev_attr.bit_depth = g_user_input_args.bit_depth;
|
||||
g_ai_config.dev_attr.pcm_samples_per_frame = g_user_input_args.samples_per_frm;
|
||||
g_ai_config.dev_attr.pcm_frame_num = DEFAULT_AI_FRAME_NUM;
|
||||
g_ai_config.dev_attr.mode = g_user_input_args.workmode;
|
||||
g_ai_config.chn_attr.sample_rate = g_user_input_args.usr_sample_rate;
|
||||
g_ai_config.chn_attr.interleaved = XMEDIA_TRUE;
|
||||
g_ai_config.source = AI_EC_SOURCE_AO_DAC0;
|
||||
g_ai_config.ec_chn_id = 0;
|
||||
g_ai_config.vqe_enable = XMEDIA_FALSE;
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_init_audio()
|
||||
{
|
||||
return sample_comm_audio_init();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_deinit_audio()
|
||||
{
|
||||
return sample_comm_audio_exit();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
if (g_user_input_args.send_object == 0) {
|
||||
ret = sample_comm_ai_destroy_output_thread_to_file(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_destroy_output_thread_to_file");
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_stop(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_stop");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static xmedia_s32 sample_start_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ai_config_init();
|
||||
CHECK_RET(ret, "sample_ai_config_init");
|
||||
|
||||
ret = sample_comm_ai_start(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_start");
|
||||
|
||||
if (g_user_input_args.send_object == 0) {
|
||||
ret = sample_comm_ai_create_output_thread_to_file(&g_ai_config, g_user_input_args.output_fd);
|
||||
CHECK_RET(ret, "sample_comm_ai_create_output_thread_to_file");
|
||||
}
|
||||
|
||||
if (g_user_input_args.dev == XMEDIA_AI_DEV_ADC0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&g_user_input_args.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
ERR:
|
||||
sample_stop_ai();
|
||||
return ret;
|
||||
}
|
||||
|
||||
xmedia_s32 sample_audio_ai(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
xmedia_s32 val;
|
||||
xmedia_char input_cmd[32];
|
||||
|
||||
ret = sample_init_audio();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_INIT_AUDIO;
|
||||
}
|
||||
|
||||
ret = sample_start_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AI;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'scvXX' to set input vol to xx dB\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'gcv' to get input vol\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nSet codec input volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_GET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nGet codec input volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
sample_stop_ai();
|
||||
ERR_START_AI:
|
||||
ERR_INIT_AUDIO:
|
||||
sample_deinit_audio();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_usage(user_input_args* args)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_mic_vol [Samplerate] [Chn] [CodecInputVol] [MicFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" [Samplerate]: Work Samplerate, 8000 or 16000\n");
|
||||
SAMPLE_AUDIO_DBG(" [Chn]: Channel, 1 or 2\n");
|
||||
SAMPLE_AUDIO_DBG(" [CodecInputVol]: audiocodec mic input volume, range:[-95~48]\n");
|
||||
SAMPLE_AUDIO_DBG(" [MicFile]: file for saving mic data\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_mic_vol 16000 1 20 /tmp/mic_gain.pcm\n");
|
||||
}
|
||||
|
||||
static xmedia_s32 user_args_init(int argc, char* argv[], user_input_args* user_in_args)
|
||||
{
|
||||
user_in_args->sample = argv[0];
|
||||
|
||||
if ((argc >= 2) && (strcmp(argv[1], "-h")) == 0) {
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (argc != 5) {
|
||||
printf("Invalid argc:%d\n", argc);
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
user_in_args->dev = XMEDIA_AI_DEV_ADC0;
|
||||
user_in_args->sample_rate = atoi(argv[1]);
|
||||
user_in_args->usr_sample_rate = atoi(argv[1]);
|
||||
user_in_args->bit_depth = AUDIO_BIT_DEPTH_16;
|
||||
user_in_args->channels = atoi(argv[2]);
|
||||
user_in_args->workmode = 1; /*queue mode*/
|
||||
user_in_args->samples_per_frm = user_in_args->usr_sample_rate / 100;
|
||||
user_in_args->codec_input_vol = atoi(argv[3]);
|
||||
user_in_args->send_object = 0;
|
||||
user_in_args->binder_mode = XMEDIA_TRUE;
|
||||
|
||||
memcpy(user_in_args->output_file_name, argv[4], strlen(argv[4]));
|
||||
if (strcmp(user_in_args->output_file_name, "null")) {
|
||||
user_in_args->output_fd[0] = fopen(user_in_args->output_file_name, "w+");
|
||||
if (user_in_args->output_fd[0] == NULL) {
|
||||
printf("Open %s failed\n", user_in_args->output_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_deinit(user_input_args* user_in_args)
|
||||
{
|
||||
if (user_in_args->output_fd[1] != NULL) {
|
||||
fclose(user_in_args->output_fd[1]);
|
||||
user_in_args->output_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
user_in_args->output_fd[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = user_args_init(argc, argv, &g_user_input_args);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("user_args_init failed(0x%x)\n\n", ret);
|
||||
return ret;
|
||||
}
|
||||
SAMPLE_AUDIO_DBG("user_args_init ok\n");
|
||||
|
||||
ret = sample_audio_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_auido_ai failed(0x%x)\n", ret);
|
||||
}
|
||||
|
||||
user_args_deinit(&g_user_input_args);
|
||||
printf("exit sample ai\n");
|
||||
return ret;
|
||||
}
|
||||
Executable
+350
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
//#include "sample_comm.h"
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_enhance_v1.h"
|
||||
#include "xmedia_audio_vqe_enhance_v2.h"
|
||||
#include "xmedia_audio_vqe_enhance_v3.h"
|
||||
#include "sample_comm_audio.h"
|
||||
#include "config_parameter/config_load_parameter.h"
|
||||
|
||||
static ai_vqe_attr_v1 v1_attr;
|
||||
static ai_vqe_attr_v2 v2_attr;
|
||||
static ai_vqe_attr_v3 v3_attr;
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define MAX_FILE_NAME_LEN 128
|
||||
#define FRAME_TIME 10 //ms
|
||||
|
||||
typedef struct user_input_args {
|
||||
xmedia_char* sample;
|
||||
audio_sample_rate sample_rate;
|
||||
audio_sample_rate usr_sample_rate;
|
||||
audio_channel channels;
|
||||
xmedia_bool binder_mode;
|
||||
xmedia_s32 codec_input_vol;
|
||||
xmedia_s32 ai_vqe_vol;
|
||||
|
||||
char output_file_name[MAX_FILE_NAME_LEN];
|
||||
char config_file_name[MAX_FILE_NAME_LEN];
|
||||
FILE *output_fd[2];
|
||||
} user_input_args;
|
||||
|
||||
static user_input_args g_user_input_args;
|
||||
static sample_ai_config g_ai_config;
|
||||
static sample_aenc_config g_aenc_config;
|
||||
static user_base_config base_config;
|
||||
|
||||
static xmedia_s32 sample_ai_config_init(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
g_ai_config.dev = XMEDIA_AI_DEV_ADC0;
|
||||
|
||||
sample_comm_ai_get_default_attr(g_ai_config.dev, &g_ai_config.dev_attr);
|
||||
|
||||
ret = load_base_parameter(g_user_input_args.config_file_name, &base_config);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
g_user_input_args.codec_input_vol = base_config.codec_input_vol;
|
||||
g_user_input_args.ai_vqe_vol = base_config.ai_vqe_vol;
|
||||
g_ai_config.dev_attr.channels = base_config.in_chn_cnt;
|
||||
g_ai_config.dev_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.dev_attr.pcm_samples_per_frame = base_config.sample_per_frame;
|
||||
g_ai_config.dev_attr.pcm_frame_num = base_config.frame_nums;
|
||||
g_ai_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
g_ai_config.chn_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.source = AI_EC_SOURCE_AO_DAC0;
|
||||
g_ai_config.ec_chn_id = 0;
|
||||
g_ai_config.res_enable = XMEDIA_FALSE;
|
||||
if ((g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_8000 && g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_16000)
|
||||
|| (g_ai_config.chn_attr.sample_rate != g_ai_config.dev_attr.sample_rate)) {
|
||||
g_ai_config.res_enable = XMEDIA_TRUE;
|
||||
}
|
||||
|
||||
g_ai_config.vqe_enable = XMEDIA_TRUE;
|
||||
if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_1) {
|
||||
g_ai_config.vqe_attr.attr = &v1_attr;
|
||||
} else if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_2) {
|
||||
g_ai_config.vqe_attr.attr = &v2_attr;
|
||||
} else if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_3) {
|
||||
g_ai_config.vqe_attr.attr = &v3_attr;
|
||||
}
|
||||
g_ai_config.vqe_attr.version = base_config.vqe_version;
|
||||
g_ai_config.vqe_attr.work_sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.vqe_attr.in_channels = base_config.in_chn_cnt;
|
||||
ret = load_aivqe_parameter(g_user_input_args.config_file_name, &g_ai_config.vqe_attr);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_aenc_config_init(xmedia_void)
|
||||
{
|
||||
voice_format format = VOICE_FORMAT_G711_A;
|
||||
audio_codec_type type = CODEC_TYPE_G711;
|
||||
|
||||
sample_comm_get_codec_info(g_user_input_args.output_file_name, &type, &format);
|
||||
g_aenc_config.sample_rate = base_config.work_samplerate;
|
||||
g_aenc_config.channels = base_config.out_chn_cnt;//g_user_input_args.channels;
|
||||
g_aenc_config.bit_depth = 16;
|
||||
g_aenc_config.chn = 0;
|
||||
g_aenc_config.type = type;
|
||||
g_aenc_config.format = format;
|
||||
g_aenc_config.binder_dev = g_ai_config.dev;
|
||||
if (g_user_input_args.binder_mode == XMEDIA_TRUE) {
|
||||
g_aenc_config.binder_src = MOD_ID_AI;
|
||||
}
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_init_audio()
|
||||
{
|
||||
return sample_comm_audio_init();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_deinit_audio()
|
||||
{
|
||||
return sample_comm_audio_exit();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_ai_destroy_output_thread_to_aenc(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_destroy_data_thread");
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_stop(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
xmedia_u32 mask = 0;
|
||||
|
||||
ret = sample_ai_config_init();
|
||||
CHECK_RET(ret, "sample_ai_config_init");
|
||||
if (g_ai_config.vqe_attr.version == AI_VQE_ENHANCE_ATTR_VERSION_1) {
|
||||
mask = v1_attr.mask;
|
||||
} else if (g_ai_config.vqe_attr.version == AI_VQE_ENHANCE_ATTR_VERSION_2) {
|
||||
mask = v2_attr.mask;
|
||||
} else if (g_ai_config.vqe_attr.version == AI_VQE_ENHANCE_ATTR_VERSION_3) {
|
||||
mask = v3_attr.mask;
|
||||
}
|
||||
ret = sample_comm_ai_register(mask, g_ai_config.vqe_attr.version, g_ai_config.res_enable);
|
||||
CHECK_RET(ret, "sample_comm_ai_register");
|
||||
|
||||
ret = sample_comm_ai_start(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_start");
|
||||
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_ai_create_output_thread_to_aenc(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_create_data_thread");
|
||||
}
|
||||
|
||||
if (g_ai_config.dev == XMEDIA_AI_DEV_ADC0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&g_user_input_args.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
} else if (g_ai_config.dev == XMEDIA_AI_DEV_PDM0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_MIC_GAIN, (xmedia_void*)&g_user_input_args.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_set_volume(&g_ai_config, g_user_input_args.ai_vqe_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_volume failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
ERR:
|
||||
sample_stop_ai();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_aenc()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_aenc_config_init();
|
||||
CHECK_RET(ret, "sample_aenc_config_init");
|
||||
|
||||
ret = sample_comm_aenc_register(g_aenc_config.type);
|
||||
CHECK_RET(ret, "sample_comm_adec_register");
|
||||
|
||||
ret = sample_comm_aenc_start(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_start");
|
||||
|
||||
ret = sample_comm_aenc_create_output_thread_to_file(&g_aenc_config, g_user_input_args.output_fd);
|
||||
CHECK_RET(ret, "sample_comm_aenc_create_data_thread");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_aenc()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_comm_aenc_destroy_output_thread_to_file(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_create_out_to_file_thread");
|
||||
|
||||
ret = sample_comm_aenc_stop(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_stop");
|
||||
|
||||
ret = sample_comm_aenc_unregister(g_aenc_config.type);
|
||||
CHECK_RET(ret, "sample_comm_aenc_unregister");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
xmedia_s32 sample_audio_record_vqe(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_init_audio();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_INIT_AUDIO;
|
||||
}
|
||||
|
||||
ret = sample_start_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AI;
|
||||
}
|
||||
|
||||
ret = sample_start_aenc();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AENC;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
int val;
|
||||
xmedia_char input_cmd[32];
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'scvXX' to set input vol to xx dB\n");
|
||||
SAMPLE_AUDIO_DBG(">>> Input 'gcv' to get input vol\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nSet codec input volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'c' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_GET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nGet codec input volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
sample_stop_aenc();
|
||||
ERR_START_AENC:
|
||||
sample_stop_ai();
|
||||
ERR_START_AI:
|
||||
ERR_INIT_AUDIO:
|
||||
sample_deinit_audio();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_usage(user_input_args* args)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_record [Config] [OutFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" Config : alg parameters config file\n");
|
||||
SAMPLE_AUDIO_DBG(" OutFile : vqe out file\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_record ./config_parameter/record_ai_vqev1_16k_1ch.ini /tmp/vqe_out.pcm\n");
|
||||
}
|
||||
|
||||
static xmedia_s32 user_args_init(int argc, char* argv[], user_input_args* user_in_args)
|
||||
{
|
||||
user_in_args->sample = argv[0];
|
||||
|
||||
if ((argc >= 3) && (strcmp(argv[1], "-h")) == 0) {
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (argc != 3) {
|
||||
printf("Invalid argc:%d\n", argc);
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
user_in_args->binder_mode = XMEDIA_TRUE;
|
||||
|
||||
memcpy(user_in_args->config_file_name, argv[1], strlen(argv[1]));
|
||||
|
||||
memcpy(user_in_args->output_file_name, argv[2], strlen(argv[2]));
|
||||
user_in_args->output_fd[0] = fopen(user_in_args->output_file_name, "w+");
|
||||
if (user_in_args->output_fd[0] == NULL) {
|
||||
printf("Open %s failed\n", user_in_args->output_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
SAMPLE_AUDIO_DBG(" mic0_file_name:%s\n", user_in_args->output_file_name);
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_deinit(user_input_args* user_in_args)
|
||||
{
|
||||
if (user_in_args->output_fd[1] != NULL) {
|
||||
fclose(user_in_args->output_fd[1]);
|
||||
user_in_args->output_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
user_in_args->output_fd[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = user_args_init(argc, argv, &g_user_input_args);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("user_args_init failed(0x%x)\n\n", ret);
|
||||
return ret;
|
||||
}
|
||||
SAMPLE_AUDIO_DBG("user_args_init ok\n");
|
||||
|
||||
ret = sample_audio_record_vqe();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_audio_record_vqev1 failed(0x%x)\n", ret);
|
||||
}
|
||||
|
||||
user_args_deinit(&g_user_input_args);
|
||||
SAMPLE_AUDIO_DBG("exit %s\n", g_user_input_args.sample);
|
||||
return ret;
|
||||
}
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ao.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_enhance_v1.h"
|
||||
#include "xmedia_audio_vqe_enhance_v2.h"
|
||||
#include "sample_comm_audio.h"
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define SLEEP_TIME 10000 /* 5ms */
|
||||
#define INPUT_CMD_LENGTH 32
|
||||
|
||||
#define SEED_FRAME_TIME 10 /*10ms*/
|
||||
#define ACQUIRE_FRAME_STATUS 1
|
||||
#define SEND_FRAME_STATUS 0
|
||||
#define DEFAULT_AO_FRAME_NUM 30
|
||||
|
||||
#define SAMPLE_GET_INPUTCMD(input_cmd) fgets((char *)(input_cmd), (sizeof(input_cmd) - 1), stdin)
|
||||
static sample_ao_config g_ao_config = {0};
|
||||
static xmedia_s32 gain = 0;
|
||||
|
||||
typedef struct {
|
||||
xmedia_char *sample;
|
||||
xmedia_char *dev_rate;
|
||||
xmedia_char *dev_chn;
|
||||
xmedia_char *gain;
|
||||
xmedia_char *in_stream;
|
||||
} input_arg;
|
||||
|
||||
typedef struct {
|
||||
FILE *in_stream[2];
|
||||
ao_dev dev;
|
||||
ao_chn chn;
|
||||
xmedia_u32 vqe;
|
||||
xmedia_u32 frm_rate;
|
||||
xmedia_u32 frm_chn;
|
||||
xmedia_u32 dev_rate;
|
||||
xmedia_u32 dev_chn;
|
||||
xmedia_u32 frame_pcm_sample;
|
||||
audio_dev_work_mode mode;
|
||||
xmedia_u32 pcm_samples;
|
||||
} sample_ctx;
|
||||
|
||||
static xmedia_s32 sample_ctx_init(const input_arg *arg, sample_ctx *ctx)
|
||||
{
|
||||
xmedia_u32 i;
|
||||
|
||||
ctx->dev = XMEDIA_AO_DEV_DAC0;
|
||||
ctx->dev_rate = atoi(arg->dev_rate);
|
||||
ctx->dev_chn = atoi(arg->dev_chn);
|
||||
ctx->frm_rate = atoi(arg->dev_rate);
|
||||
ctx->frm_chn = atoi(arg->dev_chn);
|
||||
ctx->mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
ctx->frame_pcm_sample = ctx->dev_rate / 100;
|
||||
ctx->vqe = 0;
|
||||
gain = atoi(arg->gain);
|
||||
|
||||
for(i = 0; i < 2; i++) {
|
||||
ctx->in_stream[i] = fopen(arg->in_stream, "rb");
|
||||
if (ctx->in_stream[i] == XMEDIA_NULL) {
|
||||
SAMPLE_AUDIO_DBG("open file %s error!\n", arg->in_stream);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_ctx_deinit(sample_ctx *ctx)
|
||||
{
|
||||
xmedia_u32 i;
|
||||
|
||||
for(i = 0; i < 2; i++) {
|
||||
if (ctx->in_stream[i] != XMEDIA_NULL) {
|
||||
fclose(ctx->in_stream[i]);
|
||||
ctx->in_stream[i] = XMEDIA_NULL;
|
||||
}
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_ao_config_init(sample_ctx* ctx)
|
||||
{
|
||||
g_ao_config.dev = ctx->dev;
|
||||
|
||||
sample_comm_ao_get_default_attr(g_ao_config.dev, &g_ao_config.dev_attr);
|
||||
g_ao_config.dev_attr.pcm_frame_max_num = 10;
|
||||
g_ao_config.dev_attr.channels = ctx->dev_chn;
|
||||
g_ao_config.dev_attr.sample_rate = ctx->dev_rate;
|
||||
g_ao_config.dev_attr.pcm_samples_per_frame = ctx->frame_pcm_sample;
|
||||
g_ao_config.dev_attr.pcm_frame_max_num = DEFAULT_AO_FRAME_NUM;
|
||||
g_ao_config.dev_attr.mode = ctx->mode;
|
||||
|
||||
g_ao_config.frame_info.frm_rate = ctx->frm_rate;
|
||||
g_ao_config.frame_info.frm_chn = ctx->frm_chn;
|
||||
g_ao_config.frame_info.frm_bit = AUDIO_BIT_DEPTH_16;
|
||||
|
||||
g_ao_config.vqe_enable = ctx->vqe;
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ao(sample_ctx* ctx)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ao_config_init(ctx);
|
||||
CHECK_RET(ret, "sample_ao_config_init");
|
||||
|
||||
ret = sample_comm_ao_start(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_start");
|
||||
|
||||
sample_comm_ao_create_input_thread_from_file(&g_ao_config, ctx->in_stream);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ao()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
sample_comm_ao_destroy_input_thread_from_file(&g_ao_config);
|
||||
|
||||
ret = sample_comm_ao_stop(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void usage(input_arg *arg)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_speaker_vol [Samplerate] [Chn] [AoVol] [SpkFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" [Samplerate]: Work Samplerate, 8000 or 16000\n");
|
||||
SAMPLE_AUDIO_DBG(" [Chn]: channel, 1 or 2\n");
|
||||
SAMPLE_AUDIO_DBG(" [AoVol]: ao vqe volume, range:[-81~18]\n");
|
||||
SAMPLE_AUDIO_DBG(" [SpkFile]: file for speaker playback\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_speaker_vol 16000 1 0 test_signal_spk_volumn_16k_1ch_16bit.pcm\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_speaker_vol 8000 1 0 test_signal_spk_volumn_8k_1ch_16bit.pcm\n");
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
sample_ctx ctx;
|
||||
xmedia_s32 val = 0;
|
||||
|
||||
input_arg *arg = (input_arg *)argv;
|
||||
xmedia_char input_cmd[INPUT_CMD_LENGTH];
|
||||
|
||||
if (argc != sizeof(input_arg) / sizeof(xmedia_char *)) {
|
||||
usage(arg);
|
||||
return -1;
|
||||
}
|
||||
memset(&ctx, 0, sizeof(sample_ctx));
|
||||
|
||||
ret = sample_ctx_init(arg, &ctx);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
SAMPLE_AUDIO_DBG("call sample_ctx_init failed(0x%x)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
sample_comm_audio_init();
|
||||
|
||||
ret = sample_start_ao(&ctx);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
SAMPLE_AUDIO_DBG("call sample_start_ao failed(0x%x)\n", ret);
|
||||
goto START_AO_ERR;
|
||||
}
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, gain);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
SAMPLE_AUDIO_DBG("call sample_start_ao failed(0x%x)\n", ret);
|
||||
goto SET_VOL_ERR;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'svXX' to set ao vqe volume to xx\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'gv' to get ao vqe volume\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'v' ) {
|
||||
val = atoi(input_cmd + 2);
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, val);
|
||||
SAMPLE_AUDIO_DBG("\nSet ao vqe volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'v' ) {
|
||||
ret = sample_comm_ao_get_volume(&g_ao_config, &val);
|
||||
SAMPLE_AUDIO_DBG("\nGet ao vqe volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
SET_VOL_ERR:
|
||||
sample_stop_ao();
|
||||
START_AO_ERR:
|
||||
sample_comm_audio_exit();
|
||||
sample_ctx_deinit(&ctx);
|
||||
SAMPLE_AUDIO_DBG("exit %s\n", arg->sample);
|
||||
return ret;
|
||||
}
|
||||
Executable
+516
@@ -0,0 +1,516 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
//#include "sample_comm.h"
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
#include "xmedia_audio_vqe.h"
|
||||
#include "xmedia_audio_vqe_enhance_v1.h"
|
||||
#include "xmedia_audio_vqe_enhance_v2.h"
|
||||
#include "sample_comm_audio.h"
|
||||
#include "config_parameter/config_load_parameter.h"
|
||||
|
||||
#define SAMPLE_AUDIO_DBG printf
|
||||
#define MAX_FILE_NAME_LEN 128
|
||||
#define FRAME_TIME 10 //ms
|
||||
|
||||
typedef struct user_input_args {
|
||||
xmedia_char* sample;
|
||||
audio_sample_rate sample_rate;
|
||||
audio_sample_rate usr_sample_rate;
|
||||
audio_channel channels;
|
||||
xmedia_bool binder_mode;
|
||||
audio_sample_rate file_samplerate;
|
||||
|
||||
char input_file_name[MAX_FILE_NAME_LEN];
|
||||
char output_file_name[MAX_FILE_NAME_LEN];
|
||||
char aivqe_config_file_name[MAX_FILE_NAME_LEN];
|
||||
char aovqe_config_file_name[MAX_FILE_NAME_LEN];
|
||||
FILE *input_fd[2];
|
||||
FILE *output_fd[2];
|
||||
} user_input_args;
|
||||
|
||||
static user_input_args g_user_input_args;
|
||||
static sample_ai_config g_ai_config;
|
||||
static sample_ao_config g_ao_config;
|
||||
static sample_adec_config g_adec_config;
|
||||
static sample_aenc_config g_aenc_config;
|
||||
|
||||
static user_base_config base_config;
|
||||
static ai_vqe_attr_v1 ai_v1_attr;
|
||||
static ai_vqe_attr_v2 ai_v2_attr;
|
||||
static ao_vqe_attr_v1 ao_v1_attr;
|
||||
static ao_vqe_attr_v2 ao_v2_attr;
|
||||
|
||||
static xmedia_s32 sample_ai_config_init(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
g_ai_config.dev = XMEDIA_AI_DEV_ADC0;
|
||||
sample_comm_ai_get_default_attr(g_ai_config.dev, &g_ai_config.dev_attr);
|
||||
g_ai_config.dev_attr.channels = base_config.in_chn_cnt;
|
||||
g_ai_config.dev_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.dev_attr.pcm_samples_per_frame = base_config.sample_per_frame;
|
||||
g_ai_config.dev_attr.pcm_frame_num = base_config.frame_nums;
|
||||
g_ai_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
g_ai_config.chn_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.source = AI_EC_SOURCE_AO_DAC0;
|
||||
g_ai_config.ec_chn_id = 0;
|
||||
g_ai_config.res_enable = XMEDIA_FALSE;
|
||||
if ((g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_8000 && g_ai_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_16000)
|
||||
|| (g_ai_config.chn_attr.sample_rate != g_ai_config.dev_attr.sample_rate)) {
|
||||
g_ai_config.res_enable = XMEDIA_TRUE;
|
||||
}
|
||||
|
||||
g_ai_config.vqe_enable = XMEDIA_TRUE;
|
||||
if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_1) {
|
||||
g_ai_config.vqe_attr.attr = &ai_v1_attr;
|
||||
} else if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_2) {
|
||||
g_ai_config.vqe_attr.attr = &ai_v2_attr;
|
||||
}
|
||||
g_ai_config.vqe_attr.version = base_config.vqe_version;
|
||||
g_ai_config.vqe_attr.work_sample_rate = base_config.work_samplerate;
|
||||
g_ai_config.vqe_attr.in_channels = base_config.in_chn_cnt;
|
||||
ret = load_aivqe_parameter(g_user_input_args.aivqe_config_file_name, &g_ai_config.vqe_attr);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_ao_config_init(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
g_ao_config.dev = XMEDIA_AO_DEV_DAC0;
|
||||
|
||||
sample_comm_ao_get_default_attr(g_ao_config.dev, &g_ao_config.dev_attr);
|
||||
g_ao_config.dev_attr.channels = base_config.out_chn_cnt;
|
||||
g_ao_config.dev_attr.sample_rate = base_config.work_samplerate;
|
||||
g_ao_config.dev_attr.pcm_samples_per_frame = base_config.sample_per_frame;
|
||||
g_ao_config.dev_attr.pcm_frame_max_num = base_config.frame_nums;
|
||||
g_ao_config.dev_attr.mode = AUDIO_DEV_WORK_MODE_QUEUE;
|
||||
//AAC/MP3不知道输入采样率,默认注册重采样,其他格式根据输入采样率决定是否注册
|
||||
g_ao_config.res_enable = XMEDIA_FALSE;
|
||||
if ((g_adec_config.type == CODEC_TYPE_AAC || g_adec_config.type == CODEC_TYPE_MP3) ||
|
||||
(g_ao_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_8000 && g_ao_config.dev_attr.sample_rate != AUDIO_SAMPLE_RATE_16000)
|
||||
|| (g_ao_config.frame_info.frm_rate != g_ao_config.dev_attr.sample_rate)) {
|
||||
g_ao_config.res_enable = XMEDIA_TRUE;
|
||||
}
|
||||
|
||||
g_ao_config.vqe_enable = XMEDIA_TRUE;
|
||||
g_ao_config.vqe_attr.version = base_config.vqe_version;
|
||||
if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_1) {
|
||||
g_ao_config.vqe_attr.attr = &ao_v1_attr;
|
||||
} else if (base_config.vqe_version == AI_VQE_ENHANCE_ATTR_VERSION_2) {
|
||||
g_ao_config.vqe_attr.attr = &ao_v2_attr;
|
||||
}
|
||||
ret = load_aovqe_parameter(g_user_input_args.aovqe_config_file_name, &g_ao_config.vqe_attr);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (g_user_input_args.binder_mode == XMEDIA_TRUE) {
|
||||
g_ao_config.binder_src = MOD_ID_ADEC;
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_adec_config_init(xmedia_void)
|
||||
{
|
||||
voice_format format = VOICE_FORMAT_G711_A;
|
||||
audio_codec_type type = CODEC_TYPE_G711;
|
||||
|
||||
sample_comm_get_codec_info(g_user_input_args.input_file_name, &type, &format);
|
||||
|
||||
g_adec_config.sample_rate = base_config.work_samplerate;
|
||||
g_adec_config.chn = 0;
|
||||
g_adec_config.type = type;
|
||||
g_adec_config.format = format;
|
||||
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_aenc_config_init(xmedia_void)
|
||||
{
|
||||
voice_format format = VOICE_FORMAT_G711_A;
|
||||
audio_codec_type type = CODEC_TYPE_G711;
|
||||
|
||||
sample_comm_get_codec_info(g_user_input_args.output_file_name, &type, &format);
|
||||
g_aenc_config.sample_rate = base_config.work_samplerate;
|
||||
g_aenc_config.channels = base_config.out_chn_cnt;
|
||||
g_aenc_config.bit_depth = 16;
|
||||
g_aenc_config.chn = 0;
|
||||
g_aenc_config.type = type;
|
||||
g_aenc_config.format = format;
|
||||
g_aenc_config.binder_dev = g_ai_config.dev;
|
||||
if (g_user_input_args.binder_mode == XMEDIA_TRUE) {
|
||||
g_aenc_config.binder_src = MOD_ID_AI;
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_init_audio()
|
||||
{
|
||||
return sample_comm_audio_init();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_deinit_audio()
|
||||
{
|
||||
return sample_comm_audio_exit();
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_ai_destroy_output_thread_to_aenc(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_destroy_data_thread");
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_stop(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ai()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ai_config_init();
|
||||
CHECK_RET(ret, "sample_ai_config_init");
|
||||
|
||||
ret = sample_comm_ai_register((g_ai_config.vqe_attr.version == AI_VQE_ENHANCE_ATTR_VERSION_1) ? ai_v1_attr.mask : ai_v2_attr.mask, g_ai_config.vqe_attr.version, g_ai_config.res_enable);
|
||||
CHECK_RET(ret, "sample_comm_ai_register");
|
||||
|
||||
ret = sample_comm_ai_start(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_start");
|
||||
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_ai_create_output_thread_to_aenc(&g_ai_config);
|
||||
CHECK_RET(ret, "sample_comm_ai_create_data_thread");
|
||||
}
|
||||
|
||||
if (g_ai_config.dev == XMEDIA_AI_DEV_ADC0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&base_config.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
} else if (g_ai_config.dev == XMEDIA_AI_DEV_PDM0) {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_MIC_GAIN, (xmedia_void*)&base_config.codec_input_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_dev_param failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = sample_comm_ai_set_volume(&g_ai_config, base_config.ai_vqe_vol);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_comm_ai_set_volume failed(0x%x)\n", ret);
|
||||
goto ERR;
|
||||
}
|
||||
return XMEDIA_SUCCESS;
|
||||
ERR:
|
||||
sample_stop_ai();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_ao()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_ao_config_init();
|
||||
CHECK_RET(ret, "sample_ao_config_init");
|
||||
|
||||
ret = sample_comm_ao_register((g_ao_config.vqe_attr.version == AO_VQE_ENHANCE_ATTR_VERSION_1) ? ao_v1_attr.mask : ao_v2_attr.mask, g_ao_config.vqe_attr.version, g_ao_config.res_enable);
|
||||
CHECK_RET(ret, "sample_comm_ai_register");
|
||||
|
||||
ret = sample_comm_ao_start(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_start");
|
||||
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, base_config.ao_vqe_vol);
|
||||
CHECK_RET(ret, "sample_comm_ao_set_volume");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_adec()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_adec_config_init();
|
||||
CHECK_RET(ret, "sample_adec_config_init");
|
||||
|
||||
ret = sample_comm_adec_register(g_adec_config.type);
|
||||
CHECK_RET(ret, "sample_comm_adec_register");
|
||||
|
||||
ret = sample_comm_adec_start(&g_adec_config);
|
||||
CHECK_RET(ret, "sample_comm_adec_start");
|
||||
|
||||
ret = sample_comm_adec_create_input_thread_from_file(&g_adec_config, g_user_input_args.input_fd);
|
||||
CHECK_RET(ret, "sample_comm_adec_create_out_to_ao_thread");
|
||||
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_adec_create_output_thread_to_ao(&g_adec_config, g_ao_config.dev, g_adec_config.chn);
|
||||
CHECK_RET(ret, "sample_comm_adec_create_out_to_ao_thread");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_start_aenc()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_aenc_config_init();
|
||||
CHECK_RET(ret, "sample_aenc_config_init");
|
||||
|
||||
ret = sample_comm_aenc_register(g_aenc_config.type);
|
||||
CHECK_RET(ret, "sample_comm_adec_register");
|
||||
|
||||
ret = sample_comm_aenc_start(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_start");
|
||||
|
||||
ret = sample_comm_aenc_create_output_thread_to_file(&g_aenc_config, g_user_input_args.output_fd);
|
||||
CHECK_RET(ret, "sample_comm_aenc_create_data_thread");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_ao()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_comm_ao_stop(&g_ao_config);
|
||||
CHECK_RET(ret, "sample_comm_ao_stop");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_adec()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_comm_adec_destroy_input_thread_from_file(&g_adec_config);
|
||||
CHECK_RET(ret, "sample_comm_adec_destroy_input_thread_from_file");
|
||||
|
||||
if (g_user_input_args.binder_mode == XMEDIA_FALSE) {
|
||||
ret = sample_comm_adec_destroy_output_thread_to_ao(&g_adec_config);
|
||||
CHECK_RET(ret, "sample_comm_adec_destroy_output_thread_to_ao");
|
||||
}
|
||||
|
||||
ret = sample_comm_adec_stop(&g_adec_config);
|
||||
CHECK_RET(ret, "sample_comm_adec_stop");
|
||||
|
||||
ret = sample_comm_adec_unregister(g_adec_config.type);
|
||||
CHECK_RET(ret, "sample_comm_adec_unregister");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_s32 sample_stop_aenc()
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_comm_aenc_destroy_output_thread_to_file(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_create_out_to_file_thread");
|
||||
|
||||
ret = sample_comm_aenc_stop(&g_aenc_config);
|
||||
CHECK_RET(ret, "sample_comm_aenc_stop");
|
||||
|
||||
ret = sample_comm_aenc_unregister(g_aenc_config.type);
|
||||
CHECK_RET(ret, "sample_comm_aenc_unregister");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
xmedia_s32 sample_audio_doubletalk(xmedia_void)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = sample_init_audio();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_INIT_AUDIO;
|
||||
}
|
||||
|
||||
ret = sample_start_adec();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_ADEC;
|
||||
}
|
||||
|
||||
ret = sample_start_ao();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AO;
|
||||
}
|
||||
|
||||
ret = sample_start_ai();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AI;
|
||||
}
|
||||
|
||||
ret = sample_start_aenc();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
goto ERR_START_AENC;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
int val;
|
||||
xmedia_char input_cmd[32];
|
||||
SAMPLE_AUDIO_DBG("\nInput 'q' ENTER to exit\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'sivXX' to set input vol to xx dB\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'giv' to get input vol\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'sovXX' to set ao vqe vol to xx\n");
|
||||
SAMPLE_AUDIO_DBG("Input 'gov' to get ao vqe vol to xx\n");
|
||||
|
||||
fgets(input_cmd, (sizeof(input_cmd) - 1), stdin);
|
||||
if (input_cmd[0] == 's' && input_cmd[1] == 'i' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_SET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nSet codec input volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'i' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ai_set_dev_param(&g_ai_config, AI_PARAM_GET_CODEC_ADC_GAIN, (xmedia_void*)&val);
|
||||
SAMPLE_AUDIO_DBG("\nGet codec input volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 's' && input_cmd[1] == 'o' && input_cmd[2] == 'v') {
|
||||
val = atoi(input_cmd + 3);
|
||||
ret = sample_comm_ao_set_volume(&g_ao_config, val);
|
||||
SAMPLE_AUDIO_DBG("\nSet ao vqe volume %d return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'g' && input_cmd[1] == 'o' && input_cmd[2] == 'v') {
|
||||
ret = sample_comm_ao_get_volume(&g_ao_config, &val);
|
||||
SAMPLE_AUDIO_DBG("\nGet ao vqe volume(%d) return 0x%x\n", val, ret);
|
||||
} else if (input_cmd[0] == 'q') {
|
||||
SAMPLE_AUDIO_DBG("Ready to exit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
sample_stop_aenc();
|
||||
ERR_START_AENC:
|
||||
sample_stop_ai();
|
||||
ERR_START_AI:
|
||||
sample_stop_ao();
|
||||
ERR_START_AO:
|
||||
sample_stop_adec();
|
||||
ERR_START_ADEC:
|
||||
ERR_INIT_AUDIO:
|
||||
sample_deinit_audio();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_usage(user_input_args* args)
|
||||
{
|
||||
SAMPLE_AUDIO_DBG("Usage:./aq_utils_test_talk [AIvqeConfig] [AOvqeConfig] [RemoteFile] [OutFile]\n");
|
||||
SAMPLE_AUDIO_DBG("Parameter comment as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" [AIvqeConfig]: AI VQE config file\n");
|
||||
SAMPLE_AUDIO_DBG(" [AOvqeConfig]: AO VQE config file\n");
|
||||
SAMPLE_AUDIO_DBG(" [RemoteFile]: speaker playback file\n");
|
||||
SAMPLE_AUDIO_DBG(" [OutFile]: vqe out file\n");
|
||||
|
||||
SAMPLE_AUDIO_DBG("Examples as follows:\n");
|
||||
SAMPLE_AUDIO_DBG(" ./aq_utils_test_talk ./config_parameter/talk_ai_vqev2_16k_2ch.ini ./config_parameter/talk_ao_vqev2_16k_1ch.ini spk_play.pcm vqe_out.pcm\n");
|
||||
}
|
||||
|
||||
static xmedia_s32 user_args_init(int argc, char* argv[], user_input_args* user_in_args)
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
user_in_args->sample = argv[0];
|
||||
|
||||
if ((argc >= 5) && (strcmp(argv[1], "-h")) == 0) {
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
if (argc != 5) {
|
||||
printf("Invalid argc:%d\n", argc);
|
||||
user_args_usage(user_in_args);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
|
||||
memcpy(user_in_args->aivqe_config_file_name, argv[1], strlen(argv[1]));
|
||||
memcpy(user_in_args->aovqe_config_file_name, argv[2], strlen(argv[2]));
|
||||
|
||||
user_in_args->binder_mode = XMEDIA_TRUE;
|
||||
memcpy(user_in_args->input_file_name, argv[3], strlen(argv[3]));
|
||||
if (strcmp(user_in_args->input_file_name, "null")) {
|
||||
user_in_args->input_fd[0] = fopen(user_in_args->input_file_name, "rb");
|
||||
if (user_in_args->input_fd[0] == NULL) {
|
||||
printf("Open %s failed\n", user_in_args->input_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
memcpy(user_in_args->output_file_name, argv[4], strlen(argv[4]));
|
||||
if (strcmp(user_in_args->output_file_name, "null")) {
|
||||
user_in_args->output_fd[0] = fopen(user_in_args->output_file_name, "w+");
|
||||
if (user_in_args->output_fd[0] == NULL) {
|
||||
fclose(user_in_args->input_fd[0]);
|
||||
printf("Open %s failed\n", user_in_args->output_file_name);
|
||||
return XMEDIA_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
SAMPLE_AUDIO_DBG(" mic0_file_name:%s\n", user_in_args->output_file_name);
|
||||
}
|
||||
|
||||
ret = load_base_parameter(g_user_input_args.aivqe_config_file_name, &base_config);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
fclose(user_in_args->input_fd[0]);
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
SAMPLE_AUDIO_DBG("load_base_parameter failed(0x%x)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static xmedia_void user_args_deinit(user_input_args* user_in_args)
|
||||
{
|
||||
if (user_in_args->output_fd[1] != NULL) {
|
||||
fclose(user_in_args->output_fd[1]);
|
||||
user_in_args->output_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->output_fd[0] != NULL) {
|
||||
fclose(user_in_args->output_fd[0]);
|
||||
user_in_args->output_fd[0] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->input_fd[1] != NULL) {
|
||||
fclose(user_in_args->input_fd[1]);
|
||||
user_in_args->input_fd[1] = NULL;
|
||||
}
|
||||
|
||||
if (user_in_args->input_fd[0] != NULL) {
|
||||
fclose(user_in_args->input_fd[0]);
|
||||
user_in_args->input_fd[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
xmedia_s32 main(int argc, char* argv[])
|
||||
{
|
||||
xmedia_s32 ret;
|
||||
|
||||
ret = user_args_init(argc, argv, &g_user_input_args);
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("user_args_init failed(0x%x)\n\n", ret);
|
||||
return ret;
|
||||
}
|
||||
SAMPLE_AUDIO_DBG("user_args_init ok\n");
|
||||
|
||||
ret = sample_audio_doubletalk();
|
||||
if (ret != XMEDIA_SUCCESS) {
|
||||
printf("sample_auido_ai failed(0x%x)\n", ret);
|
||||
}
|
||||
|
||||
user_args_deinit(&g_user_input_args);
|
||||
SAMPLE_AUDIO_DBG("exit %s\n", g_user_input_args.sample);
|
||||
return ret;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
#ifndef __CONFIG_LOAD_PARAMETER_H__
|
||||
#define __CONFIG_LOAD_PARAMETER_H__
|
||||
|
||||
#include "xmedia_audio_common.h"
|
||||
#include "xmedia_audio_ao.h"
|
||||
#include "xmedia_audio_ai.h"
|
||||
|
||||
typedef struct USER_BASE_CONFIG
|
||||
{
|
||||
audio_sample_rate work_samplerate;
|
||||
xmedia_u32 in_chn_cnt;
|
||||
xmedia_u32 out_chn_cnt;
|
||||
xmedia_u32 sample_per_frame;
|
||||
xmedia_u32 frame_nums;
|
||||
xmedia_u32 vqe_version;
|
||||
|
||||
xmedia_s32 codec_input_vol;
|
||||
xmedia_s32 ai_vqe_vol;
|
||||
xmedia_s32 ao_vqe_vol;
|
||||
} user_base_config;
|
||||
|
||||
xmedia_s32 load_base_parameter(xmedia_char* ini_name, user_base_config * base_config);
|
||||
xmedia_s32 load_aivqe_parameter(xmedia_char* ini_name, ai_vqe_attr* vqe_config);
|
||||
xmedia_s32 load_aovqe_parameter(xmedia_char* ini_name, ao_vqe_attr* vqe_config);
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 2
|
||||
# 输出声道数
|
||||
outchnnum = 2
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 16: vqe detect v1
|
||||
vqe_version = 16
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
#目前bcd只支持sampleRate = 16000
|
||||
[BCD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
usr_mode = 1
|
||||
# 哭声概率,范围: [0, 100]
|
||||
alarm_threshold = 80
|
||||
# 冻结时间,范围: [0s, 120s]
|
||||
time_limit = 5
|
||||
# 激活次数,范围: [1, 5]
|
||||
time_limit_threshold_count = 3
|
||||
# 退出冻结噪声时间,范围: [0, 120]
|
||||
interval_time = 3
|
||||
|
||||
#目前GBD只支持sampleRate = 8000
|
||||
[GBD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
usr_mode = 1
|
||||
# 哭声概率,范围: [0, 100]
|
||||
alarm_threshold = 80
|
||||
# 冻结时间,范围: [0s, 120s]
|
||||
time_limit = 5
|
||||
# 激活次数,范围: [1, 5]
|
||||
time_limit_threshold_count = 1
|
||||
# 退出冻结噪声时间,范围: [0, 120]
|
||||
interval_time = 3
|
||||
|
||||
[SSL]
|
||||
# 使能模块 0: disable,1: enable,目前只支持2ch。inchnnum,outchnnum需要配置为2
|
||||
enable = 1
|
||||
# 麦克风间距,范围: [30mm, 150mm]
|
||||
mic_distance = 100
|
||||
# 灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 5
|
||||
# 0表示线阵, 1表示环阵
|
||||
shape = 0
|
||||
|
||||
[VED]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 音量阈值,范围: [-80, 0]
|
||||
volume_threshold = 0
|
||||
# 突变使能检测使能标志,0:不使能,1:使能
|
||||
mutation_flag = 0
|
||||
# 快速突变阈值,范围: [10db, 80db]
|
||||
fast_change_threshold = 10
|
||||
# 平稳突变阈值,范围: [1db, 20db]
|
||||
slow_change_threshold = 2
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
@@ -0,0 +1,166 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,166 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,170 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 2
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[BF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,170 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 2
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[BF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,128 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2 3: vqe v2
|
||||
vqe_version = 3
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,180 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 舒适噪声开关, 0 : disable 1 : enable
|
||||
cng_enable = 1
|
||||
# 高低频分频点, range : [1500, 3800]
|
||||
freq_boundary = 1800
|
||||
# 低频回声消除等级, range : [0, 9]
|
||||
low_suppress_level = 7
|
||||
# 高频回声消除等级, range : [0, 9]
|
||||
high_suppress_level = 5
|
||||
# 低频语音保护等级, range : [0, 9]
|
||||
low_enhance_voice_protect_level = 0
|
||||
# 高频语音保护等级, range : [0, 9]
|
||||
high_enhance_voice_protect_level = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,180 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 舒适噪声开关, 0 : disable 1 : enable
|
||||
cng_enable = 1
|
||||
# 高低频分频点, range : [1500, 3800]
|
||||
freq_boundary = 1800
|
||||
# 低频回声消除等级, range : [0, 9]
|
||||
low_suppress_level = 7
|
||||
# 高频回声消除等级, range : [0, 9]
|
||||
high_suppress_level = 5
|
||||
# 低频语音保护等级, range : [0, 9]
|
||||
low_enhance_voice_protect_level = 0
|
||||
# 高频语音保护等级, range : [0, 9]
|
||||
high_enhance_voice_protect_level = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,184 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 2
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 舒适噪声开关, 0 : disable 1 : enable
|
||||
cng_enable = 1
|
||||
# 高低频分频点, range : [1500, 3800]
|
||||
freq_boundary = 1800
|
||||
# 低频回声消除等级, range : [0, 9]
|
||||
low_suppress_level = 7
|
||||
# 高频回声消除等级, range : [0, 9]
|
||||
high_suppress_level = 5
|
||||
# 低频语音保护等级, range : [0, 9]
|
||||
low_enhance_voice_protect_level = 0
|
||||
# 高频语音保护等级, range : [0, 9]
|
||||
high_enhance_voice_protect_level = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[BF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,184 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 2
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 舒适噪声开关, 0 : disable 1 : enable
|
||||
cng_enable = 1
|
||||
# 高低频分频点, range : [1500, 3800]
|
||||
freq_boundary = 1800
|
||||
# 低频回声消除等级, range : [0, 9]
|
||||
low_suppress_level = 7
|
||||
# 高频回声消除等级, range : [0, 9]
|
||||
high_suppress_level = 5
|
||||
# 低频语音保护等级, range : [0, 9]
|
||||
low_enhance_voice_protect_level = 0
|
||||
# 高频语音保护等级, range : [0, 9]
|
||||
high_enhance_voice_protect_level = 0
|
||||
|
||||
[DEREVERB]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 去混响延时,范围:[5, 30]
|
||||
delay_offset = 6
|
||||
# 去混响延时偏移个数,范围:[3, 10]
|
||||
delay_count = 3
|
||||
|
||||
[VAD]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 语音检测灵敏度,范围:[0, 9]
|
||||
sensitivity_level = 6
|
||||
|
||||
[BF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
|
||||
[WNS]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 降风噪等级,范围:[0, 4]
|
||||
suppress_level = 4
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,140 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,140 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 1
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [5, 40]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,140 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 16000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 160
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [1, 10]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
@@ -0,0 +1,140 @@
|
||||
#
|
||||
# this is a test config para file.
|
||||
# !!! This parameters only use to test!!!
|
||||
#
|
||||
[basic]
|
||||
# 工作采样率 8000 or 16000,默认:8000
|
||||
sampleRate = 8000
|
||||
# 输入声道数[1,2] 1 for vqe v1, 2 for vqe v2
|
||||
inchnnum = 1
|
||||
# 输出声道数
|
||||
outchnnum = 1
|
||||
# 数据帧长 10ms:160(8k)、 320(16k)
|
||||
frameSample = 80
|
||||
# AI/AO Buffer帧数
|
||||
frameNums = 30
|
||||
# vqe 算法版本 [1~n] 1: vqe v1 2: vqe v2
|
||||
vqe_version = 2
|
||||
|
||||
[volume]
|
||||
# 麦克风Codec输入增益 范围:[-95~48]
|
||||
codec_input_vol = 20
|
||||
# AI后级Vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ai_vol = 0
|
||||
# AO 后级vqe音量 范围:[-81~18],默认:0
|
||||
vqe_ao_vol = 0
|
||||
|
||||
[ANR]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 用户场景,0:正常场景,1:音乐场景
|
||||
usr_scene = 0
|
||||
# 降噪模式,0:语音模式,偏向于保语音,1:降噪模式,偏向于降噪
|
||||
nr_mode = 0
|
||||
# 最大噪声压制增益,范围: [1, 10]
|
||||
max_suppress_gain = 6
|
||||
# 平稳噪声降噪等级,范围: [0, 9]
|
||||
suppress_level = 2
|
||||
# 非平稳噪声降噪等级,范围 : [0, 9]
|
||||
nonstationary_suppress_level = 0
|
||||
|
||||
[AGC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0:自动模式,1: 用户模式,2:高级模式
|
||||
mode = 1
|
||||
# 目标电平 范围:[-20, -1],默认:-6
|
||||
target_level = -6
|
||||
# 最大增益 范围:[0, 30],默认:20
|
||||
max_boost_gain = 20
|
||||
# 噪声底线 范围:[-120, -25],默认:-100
|
||||
noise_floor = -100
|
||||
# 调整速度 范围:[1, 100],默认:8
|
||||
attack_time = 8
|
||||
# 释放速度 范围:[1, 100],默认:20
|
||||
release_time = 20
|
||||
# 噪声压制比率,范围: [1, 100], 默认:12
|
||||
ratio = 12
|
||||
|
||||
[AEC]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 0
|
||||
|
||||
[HPF]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# 模式选择 0--自动模式 1--用户模式
|
||||
mode = 1
|
||||
# 高通滤波截至频率 范围:[80/120/150]
|
||||
freq = 80
|
||||
|
||||
[EQ]
|
||||
# 使能模块 0: disable,1: enable
|
||||
enable = 1
|
||||
# EQ 频段调节,范围:[-50~20]
|
||||
# 分别对应频率点:60, 100, 150, 200, 250, 350, 500, 800, 1.2k, 1.6k, 2k,
|
||||
# 2.4k, 2.5k, 2.8k, 3.1k, 3.4k, 3.6k, 3.8k, 3.9k, 4k,
|
||||
# 4.5k, 5k, 5.5k, 6k, 6.5k, 7k, 7.3k, 7.6k, 7.8k, 8k,
|
||||
# 其中,4.5k以上频率点只有在采样率为16k才生效
|
||||
# Freq: 60Hz
|
||||
gain_0 = 0
|
||||
# Freq: 100Hz
|
||||
gain_1 = 0
|
||||
# Freq: 150Hz
|
||||
gain_2 = 0
|
||||
# Freq: 200Hz
|
||||
gain_3 = 0
|
||||
# Freq: 250Hz
|
||||
gain_4 = 0
|
||||
# Freq: 350Hz
|
||||
gain_5 = 0
|
||||
# Freq: 500Hz
|
||||
gain_6 = 0
|
||||
# Freq: 800Hz
|
||||
gain_7 = 0
|
||||
# Freq: 1200Hz
|
||||
gain_8 = 0
|
||||
# Freq: 1600Hz
|
||||
gain_9 = 0
|
||||
# Freq: 2000Hz
|
||||
gain_10 = 0
|
||||
# Freq: 2400Hz
|
||||
gain_11 = 0
|
||||
# Freq: 2500Hz
|
||||
gain_12 = 0
|
||||
# Freq: 2800Hz
|
||||
gain_13 = 0
|
||||
# Freq: 3100Hz
|
||||
gain_14 = 0
|
||||
# Freq: 3400Hz
|
||||
gain_15 = 0
|
||||
# Freq: 3600Hz
|
||||
gain_16 = 0
|
||||
# Freq: 3800Hz
|
||||
gain_17 = 0
|
||||
# Freq: 3900Hz
|
||||
gain_18 = 0
|
||||
# Freq: 4000Hz
|
||||
gain_19 = 0
|
||||
# Freq: 4500Hz
|
||||
gain_20 = 0
|
||||
# Freq: 5000Hz
|
||||
gain_21 = 0
|
||||
# Freq: 5500Hz
|
||||
gain_22 = 0
|
||||
# Freq: 6000Hz
|
||||
gain_23 = 0
|
||||
# Freq: 6500Hz
|
||||
gain_24 = 0
|
||||
# Freq: 7000Hz
|
||||
gain_25 = 0
|
||||
# Freq: 7300Hz
|
||||
gain_26 = 0
|
||||
# Freq: 7600Hz
|
||||
gain_27 = 0
|
||||
# Freq: 7800Hz
|
||||
gain_28 = 0
|
||||
# Freq: 8000Hz
|
||||
gain_29 = 0
|
||||
Reference in New Issue
Block a user