Skip to content

Commit

Permalink
update version to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
78 committed Sep 10, 2024
1 parent 3a97934 commit 0fc9f55
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 834 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ build/
.devcontainer/
sdkconfig.old
sdkconfig
dependencies.lock
dependencies.lock
.env
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

set(PROJECT_VER "0.1.1")
set(PROJECT_VER "0.2.0")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(xiaozhi)
9 changes: 4 additions & 5 deletions main/Application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#include "model_path.h"
#include "SystemInfo.h"
#include "cJSON.h"
#include "silk_resampler.h"

#define TAG "application"
#define TAG "Application"


Application::Application() {
Expand All @@ -29,7 +28,7 @@ Application::Application() {
opus_encoder_.Configure(CONFIG_AUDIO_INPUT_SAMPLE_RATE, 1);
opus_decoder_ = opus_decoder_create(opus_decode_sample_rate_, 1, NULL);
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
assert(0 == silk_resampler_init(&resampler_state_, opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE, 1));
opus_resampler_.Configure(opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE);
}
}

Expand Down Expand Up @@ -461,7 +460,7 @@ void Application::AudioDecodeTask() {
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
int target_size = frame_size * CONFIG_AUDIO_OUTPUT_SAMPLE_RATE / opus_decode_sample_rate_;
std::vector<int16_t> resampled(target_size);
assert(0 == silk_resampler(&resampler_state_, resampled.data(), packet->pcm.data(), frame_size));
opus_resampler_.Process(packet->pcm.data(), frame_size, resampled.data(), target_size);
packet->pcm = std::move(resampled);
}
}
Expand All @@ -479,7 +478,7 @@ void Application::SetDecodeSampleRate(int sample_rate) {
opus_decode_sample_rate_ = sample_rate;
opus_decoder_ = opus_decoder_create(opus_decode_sample_rate_, 1, NULL);
if (opus_decode_sample_rate_ != CONFIG_AUDIO_OUTPUT_SAMPLE_RATE) {
assert(0 == silk_resampler_init(&resampler_state_, opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE, 1));
opus_resampler_.Configure(opus_decode_sample_rate_, CONFIG_AUDIO_OUTPUT_SAMPLE_RATE);
}
}

Expand Down
3 changes: 2 additions & 1 deletion main/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "AudioDevice.h"
#include "OpusEncoder.h"
#include "OpusResampler.h"
#include "WebSocketClient.h"
#include "FirmwareUpgrade.h"

Expand Down Expand Up @@ -74,7 +75,7 @@ class Application {

int opus_duration_ms_ = 60;
int opus_decode_sample_rate_ = CONFIG_AUDIO_OUTPUT_SAMPLE_RATE;
silk_resampler_state_struct resampler_state_;
OpusResampler opus_resampler_;

TaskHandle_t wake_word_encode_task_ = nullptr;
StaticTask_t wake_word_encode_task_buffer_;
Expand Down
5 changes: 0 additions & 5 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
set(SOURCES "AudioDevice.cc"
"SystemInfo.cc"
"SystemReset.cc"
"WebSocketClient.cc"
"OpusEncoder.cc"

"Application.cc"
"main.cc"
"FirmwareUpgrade.cc"
)

idf_component_register(SRCS ${SOURCES}
Expand Down
174 changes: 0 additions & 174 deletions main/FirmwareUpgrade.cc

This file was deleted.

24 changes: 0 additions & 24 deletions main/FirmwareUpgrade.h

This file was deleted.

6 changes: 0 additions & 6 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
menu "Xiaozhi Assistant"

config OTA_UPGRADE_URL
string "OTA Upgrade URL"
default "https://"
help
The application will access this URL to check for updates when it starts and every 24 hours.

config WEBSOCKET_URL
string "Websocket URL"
default "wss://"
Expand Down
72 changes: 0 additions & 72 deletions main/OpusEncoder.cc

This file was deleted.

Loading

0 comments on commit 0fc9f55

Please sign in to comment.