diff -Nru kylin-ai-runtime-1.0.0.0/debian/changelog kylin-ai-runtime-1.0.0.0/debian/changelog --- kylin-ai-runtime-1.0.0.0/debian/changelog 2024-09-24 10:34:10.000000000 +0800 +++ kylin-ai-runtime-1.0.0.0/debian/changelog 2025-03-14 17:33:18.000000000 +0800 @@ -1,3 +1,12 @@ +kylin-ai-runtime (1.0.0.0-ok0.19) nile; urgency=medium + + * BUG: 无 + * 需求: 无 + * 其他改动说明: 优化语音识别的数据 + * 其他改动影响域: 无 + + -- guopengfei <guopengfei@kylinos.cn> Fri, 14 Mar 2025 17:33:18 +0800 + kylin-ai-runtime (1.0.0.0-ok0.18) nile; urgency=medium * 通过dbus获取系统语言 diff -Nru kylin-ai-runtime-1.0.0.0/debian/patches/0036-build-update-changelog.patch kylin-ai-runtime-1.0.0.0/debian/patches/0036-build-update-changelog.patch --- kylin-ai-runtime-1.0.0.0/debian/patches/0036-build-update-changelog.patch 1970-01-01 08:00:00.000000000 +0800 +++ kylin-ai-runtime-1.0.0.0/debian/patches/0036-build-update-changelog.patch 2025-03-14 17:33:18.000000000 +0800 @@ -0,0 +1,86 @@ +From: Flywm <guopengfei@kylinos.cn> +Date: Fri, 14 Mar 2025 17:36:39 +0800 +Subject: build: update changelog + +--- + src/services/speechprocessor.cpp | 30 ++++++++++++++++++++++++++---- + src/services/speechprocessor.h | 1 + + 2 files changed, 27 insertions(+), 4 deletions(-) + +diff --git a/src/services/speechprocessor.cpp b/src/services/speechprocessor.cpp +index 3617e8c..752bf7f 100644 +--- a/src/services/speechprocessor.cpp ++++ b/src/services/speechprocessor.cpp +@@ -21,9 +21,11 @@ + #include <kylin-ai/ai-engine/large-model/cloudspeechengine.h> + #include <openssl/bio.h> + #include <openssl/evp.h> ++#include <openssl/buffer.h> + #include "services/threadpool/async.h" + #include "defaultkeymanager/defaultkeymanager.h" +- ++#include <iostream> ++#include <fstream> + const std::string SpeechProcessor::objectPath_ = + "/org/openkylin/aisdk/speechprocessor"; + std::set<int> SpeechProcessor::sessionIdSet_; +@@ -101,6 +103,23 @@ void SpeechProcessor::exportSkeleton() { + } + } + ++std::string SpeechProcessor::base64encode(const std::string &input) { ++ BIO *bio, *b64; ++ BUF_MEM *bufferPtr; ++ b64 = BIO_new(BIO_f_base64()); ++ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); ++ ++ bio = BIO_new(BIO_s_mem()); ++ bio = BIO_push(b64, bio); ++ BIO_write(bio, input.c_str(), input.length()); ++ BIO_flush(bio); ++ BIO_get_mem_ptr(bio, &bufferPtr); ++ std::string result(bufferPtr->data, bufferPtr->length); ++ ++ BIO_free_all(bio); ++ ++ return result; ++} + std::string SpeechProcessor::base64decode(const std::string &input, + const int dataLength) { + BIO *bio, *b64; +@@ -192,10 +211,12 @@ void SpeechProcessor::emitSynthesizingResult( + + GVariantBuilder builder; + g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); +- g_variant_builder_open (&builder, G_VARIANT_TYPE_ARRAY); +- g_variant_builder_add_value(&builder, byte_array_variant); +- g_variant_builder_close (&builder); + ++ //result.audioData转成std::string ++ std::string audioData(result.audioData.begin(), result.audioData.end()); ++ std::string encodeData = base64encode(audioData); ++ g_variant_builder_add(&builder, "s", encodeData.c_str()); ++ g_variant_builder_add(&builder, "i", result.audioData.size()); + g_variant_builder_add(&builder, "s", result.audioFormat.c_str()); + g_variant_builder_add(&builder, "i", result.audioRate); + g_variant_builder_add(&builder, "i", result.audioChannel); +@@ -332,6 +353,7 @@ void SpeechProcessor::setSessionSynthesisCallback(gint sessionId) { + } + fprintf(stdout, "interfaceName: %s\n", interfaceName.c_str()); + fprintf(stdout, "synthesis result size: %d\n", result.audioData.size()); ++ + emitSynthesizingResult(result, interfaceName.c_str(), "SynthesizingAudioResult"); + }); + +diff --git a/src/services/speechprocessor.h b/src/services/speechprocessor.h +index 870c0ec..cf04cd4 100644 +--- a/src/services/speechprocessor.h ++++ b/src/services/speechprocessor.h +@@ -46,6 +46,7 @@ private: + bool engineErrorCodeExists(int errorCode); + + std::string base64decode(const std::string &input, const int dataLength); ++ std::string base64encode(const std::string &input); + + void emitLimitedRecognizingResult(int sessionId); + void emitRecognizingResult(ai_engine::lm::speech::RecognitionResult result, diff -Nru kylin-ai-runtime-1.0.0.0/debian/patches/series kylin-ai-runtime-1.0.0.0/debian/patches/series --- kylin-ai-runtime-1.0.0.0/debian/patches/series 2024-09-24 10:34:10.000000000 +0800 +++ kylin-ai-runtime-1.0.0.0/debian/patches/series 2025-03-14 17:33:18.000000000 +0800 @@ -33,3 +33,4 @@ 0033-build-update-debian-changelog.patch 0034-update-changelog.patch 0035-update-changelog.patch +0036-build-update-changelog.patch