From: memory <496663675@qq.com> Date: Sun, 4 Jan 2026 08:48:36 +0000 (+0800) Subject: 去掉竞加sdk X-Git-Tag: 1.0.2~9 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=07a93b217aaad32e989b8e56fca0da447437addf;p=mirrors%2FShenYin.git 去掉竞加sdk --- diff --git a/DeepChordsSdk_iOS/DeepChordsSdk/Example/DeepChordsSdk/DeepChordsAiSdk.swift b/DeepChordsSdk_iOS/DeepChordsSdk/Example/DeepChordsSdk/DeepChordsAiSdk.swift index 6fb1e27..9aa91fc 100644 --- a/DeepChordsSdk_iOS/DeepChordsSdk/Example/DeepChordsSdk/DeepChordsAiSdk.swift +++ b/DeepChordsSdk_iOS/DeepChordsSdk/Example/DeepChordsSdk/DeepChordsAiSdk.swift @@ -14,7 +14,7 @@ public class DeepChordsAiSdk{ } public var isDebug:Bool = false{ didSet{ - StarburstConfig.shared().isDebug = true + StarburstConfig.shared().isDebug = false DCLogger.isDebug = isDebug } } @@ -29,7 +29,8 @@ public class DeepChordsAiSdk{ StarburstConfig.shared().sdkFolder = NSTemporaryDirectory() // StarburstConfig.shared().sdkFolder = NSHomeDirectory() + "/Documents/DeepChordsSdk" // 日志路径 - StarburstConfig.shared().logPath = logPath() +// StarburstConfig.shared().logPath = logPath() + StarburstConfig.shared().logPath = nil //是否下发文字到耳机仓 StarburstConfig.shared().enableTextSyncToDevice = false //主从耳机切换是否同步sdk信息到耳机 diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemAI-Swift.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemAI-Swift.h deleted file mode 100644 index 344f048..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemAI-Swift.h +++ /dev/null @@ -1,315 +0,0 @@ -#if 0 -#elif defined(__arm64__) && __arm64__ -// Generated by Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) -#ifndef JOYGEMAI_SWIFT_H -#define JOYGEMAI_SWIFT_H -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgcc-compat" - -#if !defined(__has_include) -# define __has_include(x) 0 -#endif -#if !defined(__has_attribute) -# define __has_attribute(x) 0 -#endif -#if !defined(__has_feature) -# define __has_feature(x) 0 -#endif -#if !defined(__has_warning) -# define __has_warning(x) 0 -#endif - -#if __has_include() -# include -#endif - -#pragma clang diagnostic ignored "-Wauto-import" -#if defined(__OBJC__) -#include -#endif -#if defined(__cplusplus) -#include -#include -#include -#include -#include -#include -#include -#else -#include -#include -#include -#include -#endif -#if defined(__cplusplus) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" -#if defined(__arm64e__) && __has_include() -# include -#else -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreserved-macro-identifier" -# ifndef __ptrauth_swift_value_witness_function_pointer -# define __ptrauth_swift_value_witness_function_pointer(x) -# endif -# ifndef __ptrauth_swift_class_method_pointer -# define __ptrauth_swift_class_method_pointer(x) -# endif -#pragma clang diagnostic pop -#endif -#pragma clang diagnostic pop -#endif - -#if !defined(SWIFT_TYPEDEFS) -# define SWIFT_TYPEDEFS 1 -# if __has_include() -# include -# elif !defined(__cplusplus) -typedef uint_least16_t char16_t; -typedef uint_least32_t char32_t; -# endif -typedef float swift_float2 __attribute__((__ext_vector_type__(2))); -typedef float swift_float3 __attribute__((__ext_vector_type__(3))); -typedef float swift_float4 __attribute__((__ext_vector_type__(4))); -typedef double swift_double2 __attribute__((__ext_vector_type__(2))); -typedef double swift_double3 __attribute__((__ext_vector_type__(3))); -typedef double swift_double4 __attribute__((__ext_vector_type__(4))); -typedef int swift_int2 __attribute__((__ext_vector_type__(2))); -typedef int swift_int3 __attribute__((__ext_vector_type__(3))); -typedef int swift_int4 __attribute__((__ext_vector_type__(4))); -typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); -typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); -typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); -#endif - -#if !defined(SWIFT_PASTE) -# define SWIFT_PASTE_HELPER(x, y) x##y -# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) -#endif -#if !defined(SWIFT_METATYPE) -# define SWIFT_METATYPE(X) Class -#endif -#if !defined(SWIFT_CLASS_PROPERTY) -# if __has_feature(objc_class_property) -# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ -# else -# define SWIFT_CLASS_PROPERTY(...) -# endif -#endif -#if !defined(SWIFT_RUNTIME_NAME) -# if __has_attribute(objc_runtime_name) -# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) -# else -# define SWIFT_RUNTIME_NAME(X) -# endif -#endif -#if !defined(SWIFT_COMPILE_NAME) -# if __has_attribute(swift_name) -# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) -# else -# define SWIFT_COMPILE_NAME(X) -# endif -#endif -#if !defined(SWIFT_METHOD_FAMILY) -# if __has_attribute(objc_method_family) -# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) -# else -# define SWIFT_METHOD_FAMILY(X) -# endif -#endif -#if !defined(SWIFT_NOESCAPE) -# if __has_attribute(noescape) -# define SWIFT_NOESCAPE __attribute__((noescape)) -# else -# define SWIFT_NOESCAPE -# endif -#endif -#if !defined(SWIFT_RELEASES_ARGUMENT) -# if __has_attribute(ns_consumed) -# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) -# else -# define SWIFT_RELEASES_ARGUMENT -# endif -#endif -#if !defined(SWIFT_WARN_UNUSED_RESULT) -# if __has_attribute(warn_unused_result) -# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -# else -# define SWIFT_WARN_UNUSED_RESULT -# endif -#endif -#if !defined(SWIFT_NORETURN) -# if __has_attribute(noreturn) -# define SWIFT_NORETURN __attribute__((noreturn)) -# else -# define SWIFT_NORETURN -# endif -#endif -#if !defined(SWIFT_CLASS_EXTRA) -# define SWIFT_CLASS_EXTRA -#endif -#if !defined(SWIFT_PROTOCOL_EXTRA) -# define SWIFT_PROTOCOL_EXTRA -#endif -#if !defined(SWIFT_ENUM_EXTRA) -# define SWIFT_ENUM_EXTRA -#endif -#if !defined(SWIFT_CLASS) -# if __has_attribute(objc_subclassing_restricted) -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# else -# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA -# endif -#endif -#if !defined(SWIFT_RESILIENT_CLASS) -# if __has_attribute(objc_class_stub) -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) -# else -# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) -# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) -# endif -#endif -#if !defined(SWIFT_PROTOCOL) -# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA -#endif -#if !defined(SWIFT_EXTENSION) -# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) -#endif -#if !defined(OBJC_DESIGNATED_INITIALIZER) -# if __has_attribute(objc_designated_initializer) -# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -# else -# define OBJC_DESIGNATED_INITIALIZER -# endif -#endif -#if !defined(SWIFT_ENUM_ATTR) -# if __has_attribute(enum_extensibility) -# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) -# else -# define SWIFT_ENUM_ATTR(_extensibility) -# endif -#endif -#if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# if __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type -# else -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) -# endif -#endif -#if !defined(SWIFT_UNAVAILABLE) -# define SWIFT_UNAVAILABLE __attribute__((unavailable)) -#endif -#if !defined(SWIFT_UNAVAILABLE_MSG) -# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) -#endif -#if !defined(SWIFT_AVAILABILITY) -# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) -#endif -#if !defined(SWIFT_WEAK_IMPORT) -# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) -#endif -#if !defined(SWIFT_DEPRECATED) -# define SWIFT_DEPRECATED __attribute__((deprecated)) -#endif -#if !defined(SWIFT_DEPRECATED_MSG) -# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) -#endif -#if !defined(SWIFT_DEPRECATED_OBJC) -# if __has_feature(attribute_diagnose_if_objc) -# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) -# else -# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) -# endif -#endif -#if defined(__OBJC__) -#if !defined(IBSegueAction) -# define IBSegueAction -#endif -#endif -#if !defined(SWIFT_EXTERN) -# if defined(__cplusplus) -# define SWIFT_EXTERN extern "C" -# else -# define SWIFT_EXTERN extern -# endif -#endif -#if !defined(SWIFT_CALL) -# define SWIFT_CALL __attribute__((swiftcall)) -#endif -#if !defined(SWIFT_INDIRECT_RESULT) -# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) -#endif -#if !defined(SWIFT_CONTEXT) -# define SWIFT_CONTEXT __attribute__((swift_context)) -#endif -#if !defined(SWIFT_ERROR_RESULT) -# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) -#endif -#if defined(__cplusplus) -# define SWIFT_NOEXCEPT noexcept -#else -# define SWIFT_NOEXCEPT -#endif -#if !defined(SWIFT_C_INLINE_THUNK) -# if __has_attribute(always_inline) -# if __has_attribute(nodebug) -# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) -# else -# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) -# endif -# else -# define SWIFT_C_INLINE_THUNK inline -# endif -#endif -#if defined(_WIN32) -#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) -# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) -#endif -#else -#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) -# define SWIFT_IMPORT_STDLIB_SYMBOL -#endif -#endif -#if defined(__OBJC__) -#if __has_feature(objc_modules) -#if __has_warning("-Watimport-in-framework-header") -#pragma clang diagnostic ignored "-Watimport-in-framework-header" -#endif -#endif - -#endif -#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" -#pragma clang diagnostic ignored "-Wduplicate-method-arg" -#if __has_warning("-Wpragma-clang-attribute") -# pragma clang diagnostic ignored "-Wpragma-clang-attribute" -#endif -#pragma clang diagnostic ignored "-Wunknown-pragmas" -#pragma clang diagnostic ignored "-Wnullability" -#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" -#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" - -#if __has_attribute(external_source_symbol) -# pragma push_macro("any") -# undef any -# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="JoyGemAI",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) -# pragma pop_macro("any") -#endif - -#if defined(__OBJC__) -#endif -#if __has_attribute(external_source_symbol) -# pragma clang attribute pop -#endif -#if defined(__cplusplus) -#endif -#pragma clang diagnostic pop -#endif - -#else -#error unsupported Swift architecture -#endif diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemAI.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemAI.h deleted file mode 100644 index f16e0fe..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemAI.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// JoyGemAI.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/10. -// - -#import - -//! Project version number for JoyGemAI. -FOUNDATION_EXPORT double JoyGemAIVersionNumber; - -//! Project version string for JoyGemAI. -FOUNDATION_EXPORT const unsigned char JoyGemAIVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemAIManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemAIManager.h deleted file mode 100644 index f60ed8d..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemAIManager.h +++ /dev/null @@ -1,140 +0,0 @@ -// -// JoyGemAIManager.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/10. -// - -#import -#import -#import -#import -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol JoyGemAIManagerDelegate - -/// 鉴权成功时回调 --(void)joyGemAuthSuccessCallback; - -/// 鉴权失败时回调 --(void)joyGemAuthFailedCallback; - -/// AI耳机动作回调 -/// - NOTE: 对话相关动作是通知,即消息来时已经发生,录音相关动作是请求,即耳机没有实际操作 -@optional --(void)joyGemAction:(JoyGemActionMode)action; - -@end - -@protocol JoyGemAIManagerDataSource - -///实现该方法,将数据转发给蓝牙 -@required --(void)joyGemSendData:(NSData*)data withCharacteristic:(CBCharacteristic*)characteristic; - -@end - -@class JoyGemDeviceManager; - -@interface JoyGemAIManager : NSObject - -@property(nonatomic, weak) id delegate; -@property(nonatomic, weak) id dataSource; - -@property(nonatomic, strong) JoyGemDeviceManager *device; - -// 实例对象 -+ (instancetype)shared; - -/// 初始化sdk -- (void)initSdk; - -/// 初始化sdk -/// - Parameter projectID: 可选方法 -- (void)initSdk:(nullable NSString*)projectID; - -/// 日志打印级别 -/// - Parameter level: 日志等级 分为关闭,简略,完全 -- (void)setLogMode:(JoyGemLogMode)mode; - -/// 日志存储路径 -/// - Parameter path: 日志存储文件路径 -/// - Description: 为空时不进行日志存储, 不支持多次配置 -- (void)setLogPath:(nullable NSString*)path; - -/// 传入蓝牙服务对象 -/// - Parameters: -/// - service: 服务对象 -/// - characteristics: 需要notify的特征 -/// - Returns: 是否正确的配置了相关服务特征 -/// - Description: Block为同步操作 -- (BOOL)configService:(CBService*)service needNotify:(void (^)(NSArray*))characteristics; - -/// 收到蓝牙设备传过来的数据,调用此方法交给sdk处理 -/// - Parameter characteristic:更新的特征 -- (void)receiveValue:(CBCharacteristic *)characteristic; - -/// 蓝牙设备已连接 -- (void)bleConnected; - -/// 蓝牙断开连接 -- (void)bleDisConnected; - -/// SDK文件存储文件夹 -/// - Parameter path: SDK文件存储路径(SDK需要用到文件存储时所指向的路径) -- (void)setCacheDirectory:(nullable NSString*)path; - -/// 清除临时文件 -/// - Description: 只会清除当前配置路径下的文件 -- (void)clearCacheDirectory; - -/// TWS耳机主从切换时是否尝试当前AI功能自动延续 -/// - Parameters: -/// - enable: 默认为false --(void)setTWSAutoSync:(BOOL)enable; - --(void)setTextAutoSync:(BOOL)enable; - --(void)setEmotionAutoSync:(BOOL)enable; - -/// 文本翻译 -/// - Parameters: -/// - text: 翻译的文字 -/// - fromLanguage: 原始语言 -/// - toLanguage: 翻译语言 -/// - stream: 结果回调 -/// - error: 错误回调 -/// - Description: 最大文本支持30K -- (void)translate:(NSString *)text from:(NSString*)fromLanguage to:(NSString*)toLanguage stream:(void (^)(NSString* llmResponse,BOOL finish))stream error:(void (^)( NSError * _Nullable err))error; - -/// 取消文本翻译 --(void)cancelTranslateRequest; - -/// 文本摘要 -/// - Parameters: -/// - text: 摘要的文字 -/// - stream: 结果回调 -/// - error: 错误回调 -/// - Description: 最大文本支持30K -- (void)summary:(NSString *)text stream:(void (^)(NSString* llmResponse,BOOL finish))stream error:(void (^)( NSError * _Nullable err))error; - -/// 取消文本摘要 --(void)cancelSummaryRequest; - - -/// 设置同传的tts回应速度 -/// - Parameters: -/// - speed: 默认1.0,范围[0.8,2] --(void)setTtsSpeed:(float)speed; - -/// 配置测试环境 -/// - Parameters: -/// - info: 测试环境字典 --(void)setDebugEnvironment:(NSDictionary*)info; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemCallManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemCallManager.h deleted file mode 100644 index 5a4dd0f..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemCallManager.h +++ /dev/null @@ -1,132 +0,0 @@ -// -// JoyGemCallController.h -// JoyGemAI -// -// Created by jjjs on 2025/7/12. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@class JoyGemCallManager; -@class JoyGemAsrModel; - -//通话录音的委托类 -@protocol JoyGemCallManagerDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@optional --(void)callManager:(JoyGemCallManager*)manager didUpdateAsr:(JoyGemAsrModel*)model DEPRECATED_MSG_ATTRIBUTE("Use callManager:didUpdateMonoAsr instead if supportStereo is false");; - -///文件生成后的回调 -/// - Parameters: -/// - path: 文件存储路径 wav格式 --(void)callManager:(JoyGemCallManager*)manager saveFile:(NSString*)path; - -///录音状态回调 -/// - Parameters: -/// - code: 状态变化 --(void)callManager:(JoyGemCallManager*)manager stateChange:(JoyGemStateCode)code; - -/// 录音错误回调 -/// - Parameters: -/// - mode:错误代码 --(void)callManager:(JoyGemCallManager*)manager onError:(JoyGemErrorCode)code; - -/// 通话录音开启时,不处于通话状态 -/// - Description: 需要确认耳机是否支持该判断,如果耳机不支持将不会收到回调 -@optional --(void)callManagerNotonCall:(JoyGemCallManager*)manager; - -///结束时的回调 -/// - Parameters: -/// - code: 录音结束的原因 --(void)callManagerStopped:(JoyGemCallManager*)manager reason:(JoyGemRecordStopCode)code; - -/// 录音完成时的回调 -/// - Description: 录音任务调用结束后,会在服务器所有响应结束后进行回调 -/// - Note: 该接口仅在任务成功完成时才会进行回调,并不保证和stop方法实现一一对应 -@optional --(void)callManagerCompleted:(JoyGemCallManager*)manager; - -@end - -@protocol JoyGemCallMonoDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)callManager:(JoyGemCallManager*)manager didUpdateMonoAsr:(JoyGemAsrModel*)model; - -/// 录音时的声波强度回调 -/// - Parameters: -/// - list: 强度数组 -/// - timestamp: 时间戳(ms) -@optional --(void)callManager:(JoyGemCallManager*)manager monoIntensity:(NSArray*)list timestamp:(NSTimeInterval)timestamp; - -@end - -@protocol JoyGemCallStereoDelegate - -///录音文字识别 -/// - Parameters: -/// - model: asr识别的对象 -/// - index: 声道序号 1,2 -@required --(void)callManager:(JoyGemCallManager*)manager didUpdateStereoAsr:(JoyGemAsrModel*)model channel:(NSUInteger)index; - -/// 录音时的声波强度回调 -/// - Parameters: -/// - lists: 强度数组(二维数组,0为左声道,1为右声道) -/// - timestamp: 时间戳(ms) -@optional --(void)callManager:(JoyGemCallManager*)manager stereoIntensity:(NSArray*>*)lists timestamp:(NSTimeInterval)timestamp; - - -@end - - -/// 通话录音的管理类 -@interface JoyGemCallManager : NSObject - -/// 委托类 -/// - Description: 通话录音状态委托 -@property(nonatomic, weak) id delegate; - -/// 耳机识别语言 -@property(nonatomic, strong) NSString* originalLanguage; - -/// 是否正在录音 -@property(nonatomic, assign) BOOL isRecording; - -/// 是否支持立体声录音 -/// - NOTE:鉴权后再使用该字段 -@property(nonatomic, assign ,readonly) BOOL supportStereo; - -/// 单声道委托 -/// - Description: 固件支持单声道通话录音时会通过此委托进行回调 -@property(nonatomic, weak) id monoDelegate; - -/// 立体声委托 -/// - Description: 固件支持双声道通话录音时会通过此委托进行回调 -@property(nonatomic, weak) id stereoDelegate; - -/// 实例对象 -+ (instancetype)shared; - -/// 开始通话录音 -- (void)start; - -/// 结束通话录音 -- (void)stop; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemChatManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemChatManager.h deleted file mode 100644 index 32c1303..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemChatManager.h +++ /dev/null @@ -1,122 +0,0 @@ -// -// JoyGemChatManager.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/21. -// - -#import -#import - -@class JoyGemChatManager; -@class JoyGemSpeaker; - - -NS_ASSUME_NONNULL_BEGIN - -@protocol JoyGemChatManagerDelegate - -///AI语音接收 -/// - Parameters: -/// - data: 音频数据 pcm格式 -/// - index: 语句ID -/// - sampleRate: 采样率 -/// - finish: 该句是否结束 --(void)chatManager:(JoyGemChatManager*)manager audioData:(nullable NSData*)data index:(NSUInteger)index sampleRate:(NSUInteger)sampleRate finish:(BOOL)isFinish; - -///用户语音识别 -/// - Parameters: -/// - text: 文字数据 -/// - index: 语句ID --(void)chatManager:(JoyGemChatManager*)manager requestText:(nullable NSString*)text index:(NSUInteger)index; - -///AI语音识别 -/// - Parameters: -/// - text: 文字数据 -/// - index: 语句ID -/// - isFinish:单次对话结束 --(void)chatManager:(JoyGemChatManager*)manager responseText:(nullable NSString*)text index:(NSUInteger)index finish:(BOOL)isFinish; - -///对话状态回调 -/// - Parameters: -/// - code: 状态变化 -@optional --(void)chatManager:(JoyGemChatManager*)manager stateChange:(JoyGemStateCode)code DEPRECATED_MSG_ATTRIBUTE("Use chatManager:eventUpdate instead"); - -///对话事件回调 -/// - Parameters: -/// - event: 对话相关事件回调 -/// - NOTE: 需要相关固件支持 -@optional --(void)chatManager:(JoyGemChatManager*)manager eventUpdate:(JoyGemChatEvent)event; - -/// 错误回调 -/// - Parameters: -/// - mode:错误代码 --(void)chatManager:(JoyGemChatManager*)manager onError:(JoyGemErrorCode)code; - -@optional --(void)chatManagerStopped:(JoyGemChatManager*)manager DEPRECATED_MSG_ATTRIBUTE("Use isActive instead"); - -@end - -//AI对话的管理类 -@interface JoyGemChatManager : NSObject - -@property(nonatomic, weak) id delegate; - -//是否正在对话录音中 -@property(nonatomic, assign) BOOL isRecording; - -///是否正在活跃中 -/// - NOTE:可以采用KVO的方式监听该对象, 单次对话不会造成该状态改变 -@property(atomic, assign) BOOL isActive DEPRECATED_MSG_ATTRIBUTE("Use chatManager:eventUpdate instead if supportEvent is true"); - -///是否支持事件上报模式 -/// - NOTE:鉴权后再使用该字段 -@property(nonatomic,assign,readonly) BOOL supportEvent; - -// 实例对象 -+ (instancetype)shared; - -/// 开启单次对话 -/// - Note: 如正在播报,需要提前关闭tts后再调用,否则开启无效 -- (void)startSingleChat; - -/// 结束单次对话 -/// - Note:请勿在开启单次对话后立刻调用该方法,否则耳机可能不会处理该次请求 -- (void)stopSingleChat; - -/// 开启连续对话 -- (void)startChat; - -/// 结束连续对话 -- (void)stopChat; - -/// 播放音频开始前需要调用此方法告诉耳机 -- (void)playAudioStart; - -/// 播放音频结束时需要调用此方法告诉耳机 -/// - Description: 如果处于连续对话状态,则在调用该方法后会直接开启下一轮对话 -- (void)playAudioEnd; - -///获取支持角色列表 -/// - Parameters: -/// - list: 角色列表 --(void)getSpeakerList:(void (^)(NSArray*))list; - -/// 配置当前角色 --(void)setSpeaker:(JoyGemSpeaker*)speaker; - -/// 重置为默认角色 --(void)resetSpearker; - -/// 进入英语口语陪练模式 --(void)startSpoken; - -/// 退出英语口语陪练模式 --(void)stopSpoken; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemDeviceManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemDeviceManager.h deleted file mode 100644 index 39217c0..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemDeviceManager.h +++ /dev/null @@ -1,101 +0,0 @@ -// -// JoyGemDeviceManager.h -// JoyGemAI -// -// Created by jjjs on 2025/9/1. -// - -#import -#import "JoyGemEnum.h" -#import "JoyGemModel.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface JoyGemDeviceManager : NSObject - -@property(nonatomic,assign) BOOL twsStatus; - -/// 获取mac地址 -/// - Returns: -/// - edrAddress: 经典蓝牙地址 -/// - bleAddress: ble蓝牙地址 --(void)macAddress:(void (^)(NSString* edrAddress,NSString* bleAddress))address error:(void (^)( NSError * _Nullable err))error; - -/// 获取软件版本 -/// - Returns: -/// - version: 软件版本 --(void)software:(void (^)(NSString* version))infomation error:(void (^)( NSError * _Nullable err))error; - - -/// 设置电量监听 -/// - Parameters: -/// - left: 左耳电量 -/// - right: 右耳电量 -/// - Description: 电量范围为0~100,当未获取到电量时,电量为-1,配置回调时,如果有历史数据,会返回最后的历史数据,耳机会在电量变更时主动上报数据 --(void)setBatteryListener:(void (^)(NSInteger left, NSInteger right))batteryListener; - -/// 主动获取电量 --(void)updateBattery; - -/// 设置耳机状态监听 -/// - Parameters: -/// - btConnected: 经典蓝牙连接状态 -/// - twsConnected : 双耳模式连接状态 -/// - Description: 部分设置需要在双耳模式下才能生效 --(void)setStatusListener:(void (^)(BOOL btConnected,BOOL twsConnected))statusListener; - -/// 主动获取耳机状态 --(void)updateStatus; - -/// 设置VAD打断状态 -/// - Parameters: -/// - isOpen: VAD打断是否开启 -/// - Description: 该设置必须在双耳模式下才能生效,否则返回失败 --(void)setVADInterruptedStatus:(BOOL)isOpen callback:(void (^)( NSError * _Nullable err))error; - -/// 获取VAD打断状态 -/// - Returns: -/// - status: VAD打断是否开启 --(void)getVADInterruptedStatus:(void (^)(BOOL isOpen))status error:(void (^)( NSError * _Nullable err))error; - - -/// 设置EQ模式 -/// - Parameters: -/// - mode: EQ模式 -/// - Description: 该设置必须在双耳模式下才能生效,否则返回失败 --(void)setEQMode:(JoyGemEQMode)mode callback:(void (^)( NSError * _Nullable err))error; - -/// 获取EQ模式 -/// - Returns: -/// - mode: VAD打断是否开启 --(void)getEQMode:(void (^)(JoyGemEQMode mode))mode error:(void (^)( NSError * _Nullable err))error; - -/// 设置自定义EQ -/// - Parameters: -/// - index: 频段 范围为0~9 -/// - gain: 增益 范围为 -12~12 -/// - Description: 该设置必须在双耳模式下才能生效,否则返回失败 --(void)setCustomEQ:(NSUInteger)index withGain:(NSInteger)gain callback:(void (^)( NSError * _Nullable err))error; - -/// 重置自定义EQ -/// - Description: 该设置必须在双耳模式下才能生效,否则返回失败 --(void)resetCustomEQ:(void (^)( NSError * _Nullable err))error; - -/// 获取自定义EQ -/// - Returns: -/// - custom: 自定义EQ类型 --(void)getCustomEQ:(void (^)(JoyGemCustomEQ*))custom error:(void (^)( NSError * _Nullable err))error; - -/// 查找耳机 -/// - Parameters: -/// - mode: 查找耳机命令类型 --(void)findHeadphone:(JoyGemFindHeadphoneMode)mode callback:(void (^)( NSError * _Nullable err))error; - -/// 获取设备DN码 -/// - Parameters: -/// - dn: 设备DN,取不到则返回空值 --(void)getDN:(void (^)(NSString*))dn error:(void (^)( NSError * _Nullable err))error; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemEnum.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemEnum.h deleted file mode 100644 index b95de14..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemEnum.h +++ /dev/null @@ -1,86 +0,0 @@ -// -// JoyGemAIEnum.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/21. -// - -#ifndef JoyGemAIEnum_h -#define JoyGemAIEnum_h - -/// 状态变化 -typedef NS_OPTIONS(NSInteger,JoyGemStateCode) { - JoyGemStateCodeStartRecord = 1001,///开始录音 - JoyGemStateCodeStopRecord = 1002,///停止录音 - JoyGemStateCodeWebsocketConnected = 3001,///socket连上 - JoyGemStateCodeWebsocketDisconnected = 3002,///socket断开连接 -}; - -/// 错误 -typedef NS_OPTIONS(NSInteger,JoyGemErrorCode) { - JoyGemErrorCodeRecordError = 1003,///录音出错 - JoyGemErrorCodeNetError = 3003,///网络错误 - JoyGemErrorCodeUnAuth = 9999,///未鉴权 -}; - -/// 录音类型 -typedef NS_ENUM(NSUInteger, JoyGemRecordMode) { - JoyGemRecordModeLive = 1, ///现场录音 - JoyGemRecordModeCall = 2, ///通话录音 -}; - -/// 日志类型 -typedef NS_ENUM(NSUInteger, JoyGemLogMode) { - JoyGemLogModeClose, ///关闭日志 - JoyGemLogModeSimple, ///简略日志 - JoyGemLogModeAll, ///完整日志 -}; - -/// 动作类型 -typedef NS_ENUM(NSUInteger, JoyGemActionMode) { - JoyGemActionModeCancel = 0, ///关闭当前AI功能 - JoyGemActionModeRecordLive = 1, ///现场录音 - JoyGemActionModeRecordCall = 2, ///通话录音 - JoyGemActionModeSi = 3, ///同声传译 - JoyGemActionModeChat = 4, ///AI对话 -}; - -/// 录音结束类型 -typedef NS_ENUM(NSUInteger, JoyGemRecordStopCode) { - JoyGemRecordStopCodeActively = 0, ///用户主动关闭录音 - JoyGemRecordStopCodePassively = 1, ///用户被动关闭录音 -}; - - -/// 对话事件类型 -typedef NS_ENUM(NSUInteger, JoyGemChatEvent) { - JoyGemChatEventIdle = 0, /// 空闲中 - JoyGemChatEventBegin, /// 开始对话(单轮对话不会产生该事件) - JoyGemChatEventEnd, /// 结束对话(单轮对话不会产生该事件) - JoyGemChatEventNewRound, /// 开始新一轮对话 - JoyGemChatEventRecording, /// 录音中 - JoyGemChatEventRspWaiting, /// 等待中 - JoyGemChatEventPlaying, /// 正在播放声音 - JoyGemChatEventPlayEnd, /// 结束播放声音 -}; - -/// EQ类型 -typedef NS_ENUM(NSUInteger, JoyGemEQMode) { - JoyGemEQModeNormal, ///普通 - JoyGemEQModeRock, ///摇滚 - JoyGemEQModePop, ///流行 - JoyGemEQModeClassic, ///经典 - JoyGemEQModeJazz, ///爵士 - JoyGemEQModeCustom, ///自定义 -}; - - -/// EQ类型 -typedef NS_ENUM(NSUInteger, JoyGemFindHeadphoneMode) { - JoyGemFindHeadphoneModeCancel, ///关闭查找耳机 - JoyGemFindHeadphoneModeLeft, ///查找左耳 - JoyGemFindHeadphoneModeRight, ///查找右耳 - JoyGemFindHeadphoneModeAll, ///查找双耳 -}; - -#endif /* JoyGemAIEnum_h */ diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemModel.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemModel.h deleted file mode 100644 index 3a7cf57..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemModel.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// JoyGemAIModel.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -///AI对话角色 -@interface JoyGemSpeaker : NSObject - -@property (nonatomic, strong) NSString *sid;/// 音色id -@property (nonatomic, strong) NSString *name;/// 名称 -@property (nonatomic, strong) NSString *type;/// 类型 -@property (nonatomic, strong) NSString *role;/// 角色 - -///默认角色 -+(JoyGemSpeaker*)defaultRole; - -///默认的口语陪练角色 -+(JoyGemSpeaker*)defaultSpoken; - -@end - -///ASR对象 -@interface JoyGemAsrModel : NSObject - -@property (nonatomic, strong) NSString *text; /// 文本 -@property (nonatomic, assign) NSUInteger index; /// 序号 -@property (nonatomic, assign) BOOL definite; /// 片段化确定(不建议作为断句标识) - -@end - -///自定义EQ设置对象 -@interface JoyGemCustomEQ : NSObject - -@property (nonatomic, strong) NSArray *bands; - -@end - -///录音声纹识别 -@interface JoyGemRecordSpeaker : NSObject - -@property (nonatomic, copy, nullable) NSString *speakerId; /// 说话人ID(字符串,如 "1") -@property (nonatomic, assign) NSInteger startTime; /// 起始时间(ms) -@property (nonatomic, assign) NSInteger endTime; /// 结束时间(ms) -@property (nonatomic, copy, nullable) NSString *text; /// 该段文本 -@property (nonatomic, assign) NSInteger index; /// 该段确定序号 - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemParam.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemParam.h deleted file mode 100644 index b1f5ab6..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemParam.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// JoyGemAIParam.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/10. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -///MARK: 语音语言 - -//自动识别中英 -extern NSString* const kJoyGemAILocalizationAuto; - -//简体中文 zh-CN -extern NSString* const kJoyGemAILocalizationZH; - -//英文 en-US -extern NSString* const kJoyGemAILocalizationEN; - -//日语 ja-JP -extern NSString* const kJoyGemAILocalizationJA; - -//韩语 ko-KR -extern NSString* const kJoyGemAILocalizationKO; - -//法语 fr-FR -extern NSString* const kJoyGemAILocalizationFR; - -//西班牙语 es-MX -extern NSString* const kJoyGemAILocalizationES; - -//葡萄牙语 pt-BR -extern NSString* const kJoyGemAILocalizationPT; - -//印尼语 id-ID -extern NSString* const kJoyGemAILocalizationID; - -//俄语(输入) ru-RU -extern NSString* const kJoyGemAILocalizationRU_Original; - -//俄语(输出) ru -extern NSString* const kJoyGemAILocalizationRU_Target; - -//马来语 ms-MY -extern NSString* const kJoyGemAILocalizationMS; - -//德语 de-DE -extern NSString* const kJoyGemAILocalizationDE; - -//菲律宾语 fil-PH -extern NSString* const kJoyGemAILocalizationFIL; - -//泰语 th-TH -extern NSString* const kJoyGemAILocalizationTH; - -//阿拉伯语 ar-SA -extern NSString* const kJoyGemAILocalizationAR; - -//越南语 vi -extern NSString* const kJoyGemAILocalizationVI; - - - -///MARK: 蓝牙相关 -/// -///AI功能使用的蓝牙服务 -extern NSString* const kJoyGemAIServiceUUID; - -extern NSString* const kJoyGemAICharacteristicNotifyUUID; - - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemRecordManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemRecordManager.h deleted file mode 100644 index e95de63..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemRecordManager.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// JoyGemRecordManager.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/21. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@class JoyGemRecordManager; -@class JoyGemAsrModel; -@class JoyGemRecordSpeaker; - -//现场录音的委托类 -@protocol JoyGemRecordManagerDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)recordManager:(JoyGemRecordManager*)manager didUpdateAsr:(JoyGemAsrModel*)model; - -///文件生成后的回调 -/// - Parameters: -/// - path: 文件存储路径 wav格式 --(void)recordManager:(JoyGemRecordManager*)manager saveFile:(NSString*)path; - -///录音状态回调 -/// - Parameters: -/// - code: 状态变化 --(void)recordManager:(JoyGemRecordManager*)manager stateChange:(JoyGemStateCode)code; - -/// 录音错误回调 -/// - Parameters: -/// - mode:错误代码 --(void)recordManager:(JoyGemRecordManager*)manager onError:(JoyGemErrorCode)code; - -///结束时的回调 -/// - Parameters: -/// - code: 录音结束的原因 --(void)recordManagerStopped:(JoyGemRecordManager*)manager reason:(JoyGemRecordStopCode)code; - -/// 录音完成时的回调 -/// - Description: 录音任务调用结束后,会在服务器所有响应结束后进行回调 -/// - Note: 该接口仅在任务成功完成时才会进行回调,并不保证和stop方法实现一一对应, -@optional --(void)recordManagerCompleted:(JoyGemRecordManager*)manager; - -/// 录音时的声波强度回调 -/// - Parameters: -/// - list: 强度数组 -/// - timestamp: 时间戳(ms) -@optional --(void)recordManager:(JoyGemRecordManager*)manager intensity:(NSArray*)list timestamp:(NSTimeInterval)timestamp; - -/// 录音时的说话人区分 -/// - Parameters: -/// - list: 强度数组 -/// - timestamp: 时间戳(ms) -@optional --(void)recordManager:(JoyGemRecordManager*)manager speakers:(NSArray*)list; - -@end - -/// 现场录音的管理类 -@interface JoyGemRecordManager : NSObject - -/// 委托类 -@property(nonatomic, weak) id delegate; - -/// 耳机识别语言 -@property(nonatomic, strong) NSString* originalLanguage; - -/// 是否正在暂停中 -@property(nonatomic,assign) BOOL isPause; - -/// 是否开启声纹识别 -@property(nonatomic,assign) BOOL useVpr; - -/// 实例对象 -+ (instancetype)shared; - -/// 开启现场录音 -- (void)start; - -/// 结束现场录音 -- (void)stop; - -/// 暂停录音 -- (void)pause; - -/// 恢复录音 -- (void)resume; - - - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemSIDeviceManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemSIDeviceManager.h deleted file mode 100644 index 826b9c6..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemSIDeviceManager.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// JoyGemSIDeviceManager.h -// JoyGemAI -// -// Created by jjjs on 2025/5/21. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@class JoyGemSIDeviceManager; -@class JoyGemAsrModel; - -/// 同声传译(设备)的管理类 -@protocol JoyGemSIDeviceManagerDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager didUpdateRaw:(JoyGemAsrModel*)model; - -///录音文字翻译时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager didUpdateTranslate:(JoyGemAsrModel*)model; - -///音频数据更新时 -/// - Parameters: -/// - data: 流数据 pcm格式 -@required --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager didUpdateAudioData:(NSData*)data sampleRate:(NSUInteger)sampleRate; - -///结束时的回调 -/// - Parameters: -/// - code: 录音结束的原因 --(void)siDeviceManagerStopped:(JoyGemSIDeviceManager*)manager reason:(JoyGemRecordStopCode)code; - -/// 录音完成时的回调 -/// - Description: 录音任务调用结束后,会在服务器所有响应结束后进行回调 -/// - Note: 该接口仅在任务成功完成时才会进行回调,并不保证和stop方法实现一一对应 -@optional --(void)siDeviceManagerCompleted:(JoyGemSIDeviceManager*)manager; - -///文件生成后的回调 -/// - Parameters: -/// - path: 文件存储路径 wav格式 --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager saveFile:(NSString*)path; - -///录音状态回调 -/// - Parameters: -/// - code: 状态变化 --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager stateChange:(JoyGemStateCode)code; - -/// 录音错误回调 -/// - Parameters: -/// - mode:错误代码 --(void)siDeviceManager:(JoyGemSIDeviceManager*)manager onError:(JoyGemErrorCode)code; - -@end - -/// 同声传译(设备)的管理类 -@interface JoyGemSIDeviceManager : NSObject - -/// 委托类 -@property(nonatomic, weak) id delegate; - -/// 耳机识别语言 -@property(nonatomic, strong) NSString* originalLanguage; - -/// 耳机输出语言 -@property(nonatomic, strong) NSString* targetLanguage; - -/// 是否正在录音 -@property(nonatomic,assign) BOOL isRecording; - -/// 实例对象 -+ (instancetype)shared; - -/// 开始同声传译(设备) -- (void)start; - -/// 结束同声传译(设备) -- (void)stop; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemSIManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemSIManager.h deleted file mode 100644 index bf64e1c..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemSIManager.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// JoyGemSIManager.h -// JoyGemAI -// -// Created by JoyGem on 2025/2/21. -// - -#import -#import - -@class JoyGemSIManager; -@class JoyGemAsrModel; - -NS_ASSUME_NONNULL_BEGIN - -//同声传译的委托类 -@protocol JoyGemSIManagerDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)siManager:(JoyGemSIManager*)manager didUpdateRaw:(JoyGemAsrModel*)model; - -///录音文字翻译时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)siManager:(JoyGemSIManager*)manager didUpdateTranslate:(JoyGemAsrModel*)model; - -///音频数据更新时 -/// - Parameters: -/// - data: 流数据 pcm格式 -@required --(void)siManager:(JoyGemSIManager*)manager didUpdateAudioData:(NSData*)data sampleRate:(NSUInteger)sampleRate; - -///录音状态切换时 --(void)siManager:(JoyGemSIManager*)manager stateChange:(JoyGemStateCode)code; - -///结束时的回调 -/// - Parameters: -/// - code: 录音结束的原因 --(void)siManagerStopped:(JoyGemSIManager*)manager reason:(JoyGemRecordStopCode)code; - -/// 录音完成时的回调 -/// - Description: 录音任务调用结束后,会在服务器所有响应结束后进行回调 -/// - Note: 该接口仅在任务成功完成时才会进行回调,并不保证和stop方法实现一一对应 -@optional --(void)siManagerCompleted:(JoyGemSIManager*)manager; - -///文件生成后的回调 -/// - Parameters: -/// - path: 文件存储路径 wav格式 --(void)siManager:(JoyGemSIManager*)manager saveFile:(NSString*)path; - -/// 错误回调 --(void)siManager:(JoyGemSIManager*)manager onError:(JoyGemErrorCode)code; - -@end - -/// 同声传译的管理类 -@interface JoyGemSIManager : NSObject - -@property(nonatomic, weak) id delegate; - -///原始语言 -///目前原始语言设置无效,默认为kJoyGemAILocalizationAuto -@property(nonatomic, strong) NSString* originalLanguage; - -///目标语言 -///默认为kJoyGemAILocalizationAuto,可以设置为中文或者英文 -@property(nonatomic, strong) NSString* targetLanguage; - -/// 是否正在录音 -@property(nonatomic,assign) BOOL isRecording; - - -/// 实例对象 -+ (instancetype)shared; - -/// 开启同声传译 -- (void)start; - -/// 结束同声传译 -- (void)stop; - - -@end - -NS_ASSUME_NONNULL_END - diff --git a/ShenYin/JoyGemAI.framework/Headers/JoyGemSubtitleManager.h b/ShenYin/JoyGemAI.framework/Headers/JoyGemSubtitleManager.h deleted file mode 100644 index 18f6bc5..0000000 --- a/ShenYin/JoyGemAI.framework/Headers/JoyGemSubtitleManager.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// JoyGemSubtitleManager.h -// JoyGemAI -// -// Created by jjjs on 2025/10/17. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@class JoyGemSubtitleManager; -@class JoyGemAsrModel; - -/// 字幕翻译的委托 -@protocol JoyGemSubtitleManagerDelegate - -///录音文字识别时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)subtitleManager:(JoyGemSubtitleManager*)manager didUpdateRaw:(JoyGemAsrModel*)model; - -///录音文字翻译时 -/// - Parameters: -/// - model: asr识别的对象 -@required --(void)subtitleManager:(JoyGemSubtitleManager*)manager didUpdateTranslate:(JoyGemAsrModel*)model; - -///结束时的回调 -/// - Parameters: -/// - code: 录音结束的原因 --(void)subtitleManagerStopped:(JoyGemSubtitleManager*)manager; - -///录音状态回调 -/// - Parameters: -/// - code: 状态变化 --(void)subtitleManager:(JoyGemSubtitleManager*)manager stateChange:(JoyGemStateCode)code; - -/// 录音错误回调 -/// - Parameters: -/// - mode:错误代码 --(void)subtitleManager:(JoyGemSubtitleManager*)manager onError:(JoyGemErrorCode)code; - -@end - -//字幕翻译的管理类 -@interface JoyGemSubtitleManager : NSObject - -/// 委托类 -/// - Description: 字幕翻译状态委托 -@property(nonatomic, weak) id delegate; - -/// 耳机识别语言 -@property(nonatomic, strong) NSString* originalLanguage; - -/// 耳机输出语言 -@property(nonatomic, strong) NSString* targetLanguage; - -/// 是否正在录音 -@property(nonatomic, assign) BOOL isRecording; - -/// 是否支持字幕翻译功能 -@property(nonatomic, assign) BOOL support; - - -/// 实例对象 -+ (instancetype)shared; - -/// 开始字幕翻译 -- (void)start; - -/// 结束字幕翻译 -- (void)stop; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/JoyGemAI b/ShenYin/JoyGemAI.framework/JoyGemAI deleted file mode 100755 index b8dcb56..0000000 Binary files a/ShenYin/JoyGemAI.framework/JoyGemAI and /dev/null differ diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo deleted file mode 100644 index 8ef7c46..0000000 Binary files a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo and /dev/null differ diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.abi.json b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.abi.json deleted file mode 100644 index 993acce..0000000 --- a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.abi.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "ABIRoot": { - "kind": "Root", - "name": "JoyGemAI", - "printedName": "JoyGemAI", - "children": [ - { - "kind": "Import", - "name": "Foundation", - "printedName": "Foundation", - "declKind": "Import", - "moduleName": "JoyGemAI", - "declAttributes": [ - "RawDocComment" - ] - } - ], - "json_format_version": 8 - }, - "ConstValues": [] -} \ No newline at end of file diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.private.swiftinterface b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.private.swiftinterface deleted file mode 100644 index 428908e..0000000 --- a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.private.swiftinterface +++ /dev/null @@ -1,10 +0,0 @@ -// swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) -// swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-bare-slash-regex -module-name JoyGemAI -// swift-module-flags-ignorable: -no-verify-emitted-module-interface -import Foundation -@_exported import JoyGemAI -import Swift -import _Concurrency -import _StringProcessing -import _SwiftConcurrencyShims diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftdoc b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftdoc deleted file mode 100644 index 8d660ce..0000000 Binary files a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftdoc and /dev/null differ diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftinterface b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftinterface deleted file mode 100644 index 428908e..0000000 --- a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftinterface +++ /dev/null @@ -1,10 +0,0 @@ -// swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) -// swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-bare-slash-regex -module-name JoyGemAI -// swift-module-flags-ignorable: -no-verify-emitted-module-interface -import Foundation -@_exported import JoyGemAI -import Swift -import _Concurrency -import _StringProcessing -import _SwiftConcurrencyShims diff --git a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftmodule b/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftmodule deleted file mode 100644 index 1001f97..0000000 Binary files a/ShenYin/JoyGemAI.framework/Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftmodule and /dev/null differ diff --git a/ShenYin/JoyGemAI.framework/Modules/module.modulemap b/ShenYin/JoyGemAI.framework/Modules/module.modulemap deleted file mode 100644 index f9d9ea3..0000000 --- a/ShenYin/JoyGemAI.framework/Modules/module.modulemap +++ /dev/null @@ -1,11 +0,0 @@ -framework module JoyGemAI { - umbrella header "JoyGemAI.h" - export * - - module * { export * } -} - -module JoyGemAI.Swift { - header "JoyGemAI-Swift.h" - requires objc -} diff --git a/ShenYin/JoyGemAI.framework/_CodeSignature/CodeResources b/ShenYin/JoyGemAI.framework/_CodeSignature/CodeResources deleted file mode 100644 index 39407de..0000000 --- a/ShenYin/JoyGemAI.framework/_CodeSignature/CodeResources +++ /dev/null @@ -1,333 +0,0 @@ - - - - - files - - Headers/JoyGemAI-Swift.h - - okSjIYqQdjYFuhBqjGvwfYh8+aU= - - Headers/JoyGemAI.h - - 7HO7XUA3NdXWlvtUWyiYdTaaZ4M= - - Headers/JoyGemAIManager.h - - D/pnfOpF7qKhUfhoTsKEfdEQQRQ= - - Headers/JoyGemCallManager.h - - j3rnAsYkKzhbISebVqN00PCSeTk= - - Headers/JoyGemChatManager.h - - RmM4HQA4Ay7VLvTFWPw7s69sqBk= - - Headers/JoyGemDeviceManager.h - - GnuSbYAD+3F7R21VuV35n97Bubk= - - Headers/JoyGemEnum.h - - M1/juV+sL7ggbp4Y9srW0rq/Dqo= - - Headers/JoyGemModel.h - - WP0CE48Wvoq3FJX4ldz90bcNpTw= - - Headers/JoyGemParam.h - - fq/eezzfuJFDMFtH+PXLOMYQQCs= - - Headers/JoyGemRecordManager.h - - GzBtgXRPoBuyG0YwvFmoGA8Yg20= - - Headers/JoyGemSIDeviceManager.h - - aH1rBy/dU7IVJkpw/BVW3BvfNtk= - - Headers/JoyGemSIManager.h - - 363bn6W4/w8F3xEYQrU0LEVD/XM= - - Headers/JoyGemSubtitleManager.h - - fDUdqGo5wSc78huSI4OUK8Qr8AU= - - Info.plist - - yyyfSn0pDOYFx2gtlmBDVpKhVxw= - - Modules/JoyGemAI.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo - - CPeqh4HaaR/F9LP2LFiPwE3Qxzo= - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.abi.json - - iVs2bUNJJDbD/ENi/Q0lo4aP3uk= - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.private.swiftinterface - - sOTjmG3OZu9FvWVYyTuqSix+tzU= - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftdoc - - s/YEyU+lH4pYoG62jihLM2SJPTU= - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftinterface - - sOTjmG3OZu9FvWVYyTuqSix+tzU= - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftmodule - - OKLv2mrRkW9EiT9AdyIjFh6WmI8= - - Modules/module.modulemap - - qguEoXSNM0mFX+7WmMXUO3TTSLk= - - PrivacyInfo.xcprivacy - - SRctDO3cqibONLEG7CPcNZVBnXw= - - - files2 - - Headers/JoyGemAI-Swift.h - - hash2 - - Jktn0pvS86rbDKXpgT8xSUtpGRzWvf2yzqxwqMqFKS4= - - - Headers/JoyGemAI.h - - hash2 - - AWVDZqJirRMWfVQc7FdxP1cjTTx2LWTSTwHDN0/ySRA= - - - Headers/JoyGemAIManager.h - - hash2 - - hAXAZoFB6Ja0kc5Gm3Bo952k9fZUiSUPYM2f9gyTkQw= - - - Headers/JoyGemCallManager.h - - hash2 - - eKpRq8GaSD9YaI7Tfafc4BVLc/Vz2rS7cEcx8W6S+EI= - - - Headers/JoyGemChatManager.h - - hash2 - - TrJNORF2yq5ZRf++PfcoxEwE0ic9W2VxQ+Nz7M7WKPM= - - - Headers/JoyGemDeviceManager.h - - hash2 - - b8SW0vyfvdZ5JjAexckdczSXWjl11+WIJDM6wuHhBEo= - - - Headers/JoyGemEnum.h - - hash2 - - 6xL0kb6k/tdSxOKLIazlAA2o8gm1ZE3njRHg40EOYMw= - - - Headers/JoyGemModel.h - - hash2 - - 0kLzuK/HuYBvk9JPhWYbR2z7t1XSX83X5Am9ZD+vLXw= - - - Headers/JoyGemParam.h - - hash2 - - QKmLGG6IwVxT2QonEGJzea6rMbUX0PBNGoWpzqSNRbY= - - - Headers/JoyGemRecordManager.h - - hash2 - - ep9EdHop9Qn0M9nCT7YwmHXxJh/XXCjBqtYjErKFd+8= - - - Headers/JoyGemSIDeviceManager.h - - hash2 - - x40L/ElpDJCMjpEBZZancy57toshn0DM6MOhkwnIMYQ= - - - Headers/JoyGemSIManager.h - - hash2 - - NTKnVzoipmhtgLLzocc8J5kT4Q2qmUmVhZ3MgZUrbkA= - - - Headers/JoyGemSubtitleManager.h - - hash2 - - jGDopDnKVm0z/p6dEPEs54wWT6iwbetpqbTXTk8zoAQ= - - - Modules/JoyGemAI.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo - - hash2 - - dSyxVyC1vMbliDqKuW0d31f2wCYxeWsx2/NHJQYPrRc= - - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.abi.json - - hash2 - - li11LC5FIVL81dorkSyLKnyNa2JtjEuBDo/IzoAeVCU= - - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.private.swiftinterface - - hash2 - - Xu9oOK+bUwZsz7YKaBS7sdDWZvQJwX6GCeM7UKDOIew= - - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftdoc - - hash2 - - 4ZSTOVNx5VInV3CLCGXGsOKMICdleteG1O8aHABZCzw= - - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftinterface - - hash2 - - Xu9oOK+bUwZsz7YKaBS7sdDWZvQJwX6GCeM7UKDOIew= - - - Modules/JoyGemAI.swiftmodule/arm64-apple-ios.swiftmodule - - hash2 - - nRKcutC82zySWegf6JkCelatcDI5wxHUuHo6O2D+Osc= - - - Modules/module.modulemap - - hash2 - - EYrXhwPscfz6NC5xiiSHpFYdSR7Z5+JCyV2sAnxwmPc= - - - PrivacyInfo.xcprivacy - - hash2 - - cuaVRkQIQRl8fLAPRH2XlUdsPxO0W90uL0WcSHvmSnY= - - - - rules - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/ShenYin/ShenYin.xcodeproj/project.pbxproj b/ShenYin/ShenYin.xcodeproj/project.pbxproj index e2fdcbf..17f2faf 100644 --- a/ShenYin/ShenYin.xcodeproj/project.pbxproj +++ b/ShenYin/ShenYin.xcodeproj/project.pbxproj @@ -7,10 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 0D54E0612F0A5FDD00A80EE7 /* StarburstSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D54E0602F0A5FDD00A80EE7 /* StarburstSdk.framework */; }; 3F7602F12EFA8BAB00588C18 /* DeepChordsSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F7602EA2EFA891200588C18 /* DeepChordsSdk.framework */; }; 3F7602F22EFA8BAB00588C18 /* DeepChordsSdk.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F7602EA2EFA891200588C18 /* DeepChordsSdk.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 3F79C6142E6055E500EC38B9 /* JoyGemAI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F79C4902E603B4700EC38B9 /* JoyGemAI.framework */; }; - 3F79C6152E6055E500EC38B9 /* JoyGemAI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F79C4902E603B4700EC38B9 /* JoyGemAI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3F8F58292EBCA2B800FFC00B /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3F8F58282EBCA2B800FFC00B /* PrivacyInfo.xcprivacy */; }; F2E449CAD5874BE652A69B50 /* Pods_ShenYin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3862D5561144E20721225B96 /* Pods_ShenYin.framework */; }; /* End PBXBuildFile section */ @@ -23,7 +22,6 @@ dstSubfolderSpec = 10; files = ( 3F7602F22EFA8BAB00588C18 /* DeepChordsSdk.framework in Embed Frameworks */, - 3F79C6152E6055E500EC38B9 /* JoyGemAI.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -31,9 +29,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0D54E0602F0A5FDD00A80EE7 /* StarburstSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = StarburstSdk.framework; sourceTree = ""; }; 3862D5561144E20721225B96 /* Pods_ShenYin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShenYin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3F7602EA2EFA891200588C18 /* DeepChordsSdk.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeepChordsSdk.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3F79C4902E603B4700EC38B9 /* JoyGemAI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JoyGemAI.framework; sourceTree = ""; }; 3F887B9C2E38D8DC00C98658 /* ShenYin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShenYin.app; sourceTree = BUILT_PRODUCTS_DIR; }; 3F8F58282EBCA2B800FFC00B /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 5F5DE5910965D53C2B3405B0 /* Pods-ShenYin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShenYin.debug.xcconfig"; path = "Target Support Files/Pods-ShenYin/Pods-ShenYin.debug.xcconfig"; sourceTree = ""; }; @@ -47,6 +45,20 @@ isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( Info.plist, + Sdk/JoySdk/JoyCallRecord.swift, + Sdk/JoySdk/JoyChat.swift, + Sdk/JoySdk/JoyChinse2English.swift, + Sdk/JoySdk/JoyDialog.swift, + Sdk/JoySdk/JoyRecord.swift, + Sdk/JoySdk/JoySdkManager.swift, + Sdk/JoySdk/JoyTcty.swift, + Sdk/JoySdk/VC/JoyCallingRecordVC.swift, + Sdk/JoySdk/VC/JoyChatVC.swift, + Sdk/JoySdk/VC/JoyChinese2EnglishVC.swift, + Sdk/JoySdk/VC/JoyDialogTranlateVC.swift, + Sdk/JoySdk/VC/JoyStereoCallVC.swift, + Sdk/JoySdk/VC/JoyTctyVC.swift, + Sdk/JoySdk/VC/JoyXclyVC.swift, ); target = 3F887B9B2E38D8DC00C98658 /* ShenYin */; }; @@ -70,7 +82,7 @@ files = ( F2E449CAD5874BE652A69B50 /* Pods_ShenYin.framework in Frameworks */, 3F7602F12EFA8BAB00588C18 /* DeepChordsSdk.framework in Frameworks */, - 3F79C6142E6055E500EC38B9 /* JoyGemAI.framework in Frameworks */, + 0D54E0612F0A5FDD00A80EE7 /* StarburstSdk.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -97,6 +109,7 @@ 3F887B9D2E38D8DC00C98658 /* Products */, 34A14A83ECF09370871C891F /* Pods */, 676B86A4BA2639E8694D56B4 /* Frameworks */, + 0D54E0602F0A5FDD00A80EE7 /* StarburstSdk.framework */, ); sourceTree = ""; }; @@ -119,7 +132,6 @@ isa = PBXGroup; children = ( 3F7602EA2EFA891200588C18 /* DeepChordsSdk.framework */, - 3F79C4902E603B4700EC38B9 /* JoyGemAI.framework */, 3862D5561144E20721225B96 /* Pods_ShenYin.framework */, ); name = Frameworks; @@ -205,10 +217,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ShenYin/Pods-ShenYin-frameworks.sh\"\n"; @@ -270,7 +286,7 @@ ); GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ShenYin/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = DeepChords; + INFOPLIST_KEY_CFBundleDisplayName = "骨传导"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "扫描附近蓝牙设备需要获得权限"; INFOPLIST_KEY_NSCameraUsageDescription = "修改用户头像、提交意见反馈需要访问相册使用摄像头"; @@ -280,7 +296,6 @@ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UIUserInterfaceStyle = Light; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -292,7 +307,7 @@ "$(inherited)", "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", ); - MARKETING_VERSION = 1.0.2; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -328,7 +343,7 @@ ); GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ShenYin/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = DeepChords; + INFOPLIST_KEY_CFBundleDisplayName = "骨传导"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "扫描附近蓝牙设备需要获得权限"; INFOPLIST_KEY_NSCameraUsageDescription = "修改用户头像、提交意见反馈需要访问相册使用摄像头"; @@ -338,7 +353,6 @@ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UIUserInterfaceStyle = Light; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -350,7 +364,7 @@ "$(inherited)", "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", ); - MARKETING_VERSION = 1.0.2; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/ShenYin/ShenYin/Sdk/CCBleManager.swift b/ShenYin/ShenYin/Sdk/CCBleManager.swift index 9e356a2..dc631c2 100644 --- a/ShenYin/ShenYin/Sdk/CCBleManager.swift +++ b/ShenYin/ShenYin/Sdk/CCBleManager.swift @@ -77,9 +77,9 @@ extension CCBleManager:CBCentralManagerDelegate{ discoverDeviceCallback?(devices) } else{ - let mac = JoySdkManager.getMac(advertisementData) ?? "" - devices.append(DCPeripheral(device: peripheral,mac: mac)) - discoverDeviceCallback?(devices) +// let mac = JoySdkManager.getMac(advertisementData) ?? "" +// devices.append(DCPeripheral(device: peripheral,mac: mac)) +// discoverDeviceCallback?(devices) } // if CCDevice.isJoy{ // let mac = JoySdkManager.getMac(advertisementData) ?? "" @@ -98,7 +98,7 @@ extension CCBleManager:CBCentralManagerDelegate{ Logger.debug("蓝牙已连接 \(peripheral)") peripheral.delegate = self if CCDevice.isJoy{ - peripheral.discoverServices([CBUUID(string: JoySdkManager.serviceUUID),CBUUID(string: OtaMananger.otaServiceUUId)]); +// peripheral.discoverServices([CBUUID(string: JoySdkManager.serviceUUID),CBUUID(string: OtaMananger.otaServiceUUId)]); } else{ DCBleManager.shared.centralManager(central, didConnect: peripheral) @@ -114,7 +114,7 @@ extension CCBleManager:CBCentralManagerDelegate{ YLprogressHUD.showAutoHiden("蓝牙已断开".l10n) self.isConnetd = false if CCDevice.isJoy{ - DCBleManager.shared.centralManager(central, didDisconnectPeripheral: peripheral, error: nil) +// DCBleManager.shared.centralManager(central, didDisconnectPeripheral: peripheral, error: nil) } NotificationManager.post(type: .deviceValidChange, objtect: nil) OtaMananger.shared.otaManager.centralManager(central, didDisconnectPeripheral: peripheral, error: error) @@ -133,12 +133,12 @@ extension CCBleManager: CBPeripheralDelegate { func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { if CCDevice.isJoy{ - if (service.uuid.uuidString == JoySdkManager.serviceUUID) { - JoySdkManager.shared.peripheral(peripheral, didDiscoverCharacteristicsFor: service, error: error) - } - else if service.uuid.uuidString == OtaMananger.otaServiceUUId{ - OtaMananger.shared.otaManager.peripheral(peripheral, didDiscoverCharacteristicsFor: service, error: error) - } +// if (service.uuid.uuidString == JoySdkManager.serviceUUID) { +// JoySdkManager.shared.peripheral(peripheral, didDiscoverCharacteristicsFor: service, error: error) +// } +// else if service.uuid.uuidString == OtaMananger.otaServiceUUId{ +// OtaMananger.shared.otaManager.peripheral(peripheral, didDiscoverCharacteristicsFor: service, error: error) +// } } else{ DCBleManager.shared.peripheral(peripheral, didDiscoverCharacteristicsFor: service, error: error) @@ -147,31 +147,31 @@ extension CCBleManager: CBPeripheralDelegate { func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: (any Error)?) { if CCDevice.isJoy{ - if (characteristic.isNotifying == true && characteristic.service?.uuid.uuidString == JoySdkManager.serviceUUID && characteristic.uuid.uuidString == JoySdkManager.notifyUUID) { - Logger.debug("特征使能成功") - JoySdkManager.shared.bleConnected() - } - if OtaMananger.isOtadata(characteristic){ - OtaMananger.shared.otaManager.peripheral(peripheral, didUpdateNotificationStateFor: characteristic, error: error) - } +// if (characteristic.isNotifying == true && characteristic.service?.uuid.uuidString == JoySdkManager.serviceUUID && characteristic.uuid.uuidString == JoySdkManager.notifyUUID) { +// Logger.debug("特征使能成功") +// JoySdkManager.shared.bleConnected() +// } +// if OtaMananger.isOtadata(characteristic){ +// OtaMananger.shared.otaManager.peripheral(peripheral, didUpdateNotificationStateFor: characteristic, error: error) +// } } } func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { // Logger.debug("收到数据 ===uUId ",characteristic.uuid) if CCDevice.isJoy{ - if OtaMananger.isOtadata(characteristic){ - if let _ = characteristic.value,error == nil { - OtaMananger.shared.otaManager.peripheral(peripheral, didUpdateValueFor: characteristic) - } - else{ - Logger.debug("ota 收到数据 ===\(characteristic.uuid)","无数据") - } - } - else { - //MARK: 需要配置传入数据 - JoySdkManager.shared.receiveValue(characteristic) - } +// if OtaMananger.isOtadata(characteristic){ +// if let _ = characteristic.value,error == nil { +// OtaMananger.shared.otaManager.peripheral(peripheral, didUpdateValueFor: characteristic) +// } +// else{ +// Logger.debug("ota 收到数据 ===\(characteristic.uuid)","无数据") +// } +// } +// else { +// //MARK: 需要配置传入数据 +// JoySdkManager.shared.receiveValue(characteristic) +// } } else{ DCBleManager.shared.peripheral(peripheral, didUpdateValueFor: characteristic, error: error) @@ -201,7 +201,7 @@ extension CCBleManager{ // } // } if CCDevice.isJoy{ - centralManager.scanForPeripherals(withServices: [CBUUID(string: JoySdkManager.serviceUUID)],options: [CBCentralManagerScanOptionAllowDuplicatesKey : false]) +// centralManager.scanForPeripherals(withServices: [CBUUID(string: JoySdkManager.serviceUUID)],options: [CBCentralManagerScanOptionAllowDuplicatesKey : false]) } else{ centralManager.scanForPeripherals(withServices: [CBUUID(string: DCBleManager.serviceUUID)],options: [CBCentralManagerScanOptionAllowDuplicatesKey : false]) @@ -286,9 +286,17 @@ extension CCBleManager{ } func checkSettingsConnected()->[CBPeripheral]{ - let list = centralManager.retrieveConnectedPeripherals(withServices: [CBUUID(string: JoySdkManager.serviceUUID)]) - Logger.debug("已连接设备",list) - return list + if CCDevice.isJoy { +// let list = centralManager.retrieveConnectedPeripherals(withServices: [CBUUID(string: JoySdkManager.serviceUUID)]) +// Logger.debug("已连接设备",list) +// return list + return [] + } + else{ + let list = centralManager.retrieveConnectedPeripherals(withServices: [CBUUID(string: DCBleManager.serviceUUID)]) + Logger.debug("已连接设备",list) + return list + } } } diff --git a/ShenYin/ShenYin/Sdk/CCDevice.swift b/ShenYin/ShenYin/Sdk/CCDevice.swift index 16cefe8..b11aa9c 100644 --- a/ShenYin/ShenYin/Sdk/CCDevice.swift +++ b/ShenYin/ShenYin/Sdk/CCDevice.swift @@ -4,13 +4,13 @@ // // Created by liangshi on 2025/12/25. // -import JoyGemAI +//import JoyGemAI import DeepChordsSdk class CCDevice{ - static var isJoy = true + static var isJoy = false static func initSdk(){ if CCDevice.isJoy { - JoySdkManager.shared.setupSdk() +// JoySdkManager.shared.setupSdk() } else{ DcSdkManager.shared.initSdk() @@ -18,12 +18,12 @@ class CCDevice{ } static func translate(text:String,from:String,to:String,finished:@escaping ((stream:String,finish:Bool)?)->Void){ if isJoy { - JoyGemAIManager.shared().cancelTranslateRequest() - JoyGemAIManager.shared().translate(text, from: from, to: to) { result, finish in - finished((result,finish)) - } error: { error in - finished(nil) - } +// JoyGemAIManager.shared().cancelTranslateRequest() +// JoyGemAIManager.shared().translate(text, from: from, to: to) { result, finish in +// finished((result,finish)) +// } error: { error in +// finished(nil) +// } } else{ DeepChordsAiSdk.shared.cancelTranslateByTextWithSplit() @@ -34,12 +34,12 @@ class CCDevice{ } static func summary(text:String,finished:@escaping ((stream:String,finish:Bool)?)->Void){ if isJoy { - JoyGemAIManager.shared().cancelSummaryRequest() - JoyGemAIManager.shared().summary(text) { text, finish in - finished((text,finish)) - } error: { error in - finished(nil) - } +// JoyGemAIManager.shared().cancelSummaryRequest() +// JoyGemAIManager.shared().summary(text) { text, finish in +// finished((text,finish)) +// } error: { error in +// finished(nil) +// } } else{ DeepChordsAiSdk.shared.cancelSummaryByTextWithSplit() @@ -52,20 +52,20 @@ class CCDevice{ extension CCDevice{ static func findHeadphone(_ mode:FindType){ if CCDevice.isJoy { - var value:JoyGemFindHeadphoneMode = .all - switch mode { - case .left: - value = .left - case .right: - value = .right - case .cancel: - value = .cancel - case .all: - value = .all - } - JoyGemAIManager.shared().device.findHeadphone(value) { err in - Logger.debug("findHeadphone:\(err)"); - } +// var value:JoyGemFindHeadphoneMode = .all +// switch mode { +// case .left: +// value = .left +// case .right: +// value = .right +// case .cancel: +// value = .cancel +// case .all: +// value = .all +// } +// JoyGemAIManager.shared().device.findHeadphone(value) { err in +// Logger.debug("findHeadphone:\(err)"); +// } } else{ let value:UInt8 = mode == .cancel ? 0:1 @@ -75,27 +75,27 @@ extension CCDevice{ } static func getEQMode(finished:@escaping (ModeEffectsType?)->Void){ if CCDevice.isJoy { - JoyGemAIManager.shared().device.getEQMode { mode in - var value:ModeEffectsType = .normal - switch mode { - case .normal: - value = .normal - case .pop: - value = .pop - case .classic: - value = .classic - case .rock: - value = .rock - case .jazz: - value = .jazz - case .custom: - value = .custom - } - finished(value) - } error: { err in - Logger.debug("getEQMode:\(err)"); - finished(nil) - } +// JoyGemAIManager.shared().device.getEQMode { mode in +// var value:ModeEffectsType = .normal +// switch mode { +// case .normal: +// value = .normal +// case .pop: +// value = .pop +// case .classic: +// value = .classic +// case .rock: +// value = .rock +// case .jazz: +// value = .jazz +// case .custom: +// value = .custom +// } +// finished(value) +// } error: { err in +// Logger.debug("getEQMode:\(err)"); +// finished(nil) +// } } else{ /// type, 0x00(正常模式) @@ -130,25 +130,25 @@ extension CCDevice{ } static func setEQMode(_ type:ModeEffectsType){ if CCDevice.isJoy { - var value:JoyGemEQMode = .normal - switch type { - case .normal: - value = .normal - case .pop: - value = .pop - case .classic: - value = .classic - case .rock: - value = .rock - case .jazz: - value = .jazz - case .custom: - value = .custom - } - - JoyGemAIManager.shared().device.setEQMode(value) { err in - Logger.debug("setEQMode:\(err)"); - } +// var value:JoyGemEQMode = .normal +// switch type { +// case .normal: +// value = .normal +// case .pop: +// value = .pop +// case .classic: +// value = .classic +// case .rock: +// value = .rock +// case .jazz: +// value = .jazz +// case .custom: +// value = .custom +// } +// +// JoyGemAIManager.shared().device.setEQMode(value) { err in +// Logger.debug("setEQMode:\(err)"); +// } }else{ let value:UInt8 = UInt8(type.rawValue) DCDevice.shared.setEQ(type: value) { success in @@ -160,13 +160,13 @@ extension CCDevice{ static func getCustomEQ(finished:@escaping ([NSNumber]?)->Void){ if CCDevice.isJoy { - JoyGemAIManager.shared().device.getCustomEQ { eq in - Logger.debug("getCustomEQ:\(eq)"); - finished(eq.bands) - } error: { err in - Logger.debug("getCustomEQ:\(err)"); - finished(nil) - } +// JoyGemAIManager.shared().device.getCustomEQ { eq in +// Logger.debug("getCustomEQ:\(eq)"); +// finished(eq.bands) +// } error: { err in +// Logger.debug("getCustomEQ:\(err)"); +// finished(nil) +// } } else{ DCDevice.shared.getEQ { (arg0,result) in @@ -186,9 +186,9 @@ extension CCDevice{ } static func resetCustomEQ(){ if CCDevice.isJoy { - JoyGemAIManager.shared().device.resetCustomEQ { err in - Logger.debug("resetCustomEQ:\(err)"); - } +// JoyGemAIManager.shared().device.resetCustomEQ { err in +// Logger.debug("resetCustomEQ:\(err)"); +// } } else{ let list = [ @@ -209,9 +209,9 @@ extension CCDevice{ } static func setCustomEQ(index:Int,value:Int){ if CCDevice.isJoy { - JoyGemAIManager.shared().device.setCustomEQ(UInt(index), withGain: value) { err in - Logger.debug("setCustomEQ:\(err)"); - } +// JoyGemAIManager.shared().device.setCustomEQ(UInt(index), withGain: value) { err in +// Logger.debug("setCustomEQ:\(err)"); +// } } else{ DCDevice.shared.setCustomEQ(index: UInt8(index), value: value) {result in @@ -238,12 +238,12 @@ extension CCDevice{ // } static func getDN(finished:@escaping ((_ mac:String?)->Void)) { if CCDevice.isJoy { - JoyGemAIManager.shared().device.getDN { deviceName in - finished(deviceName) - } error: { error in - Logger.debug("获取dn失败","\(error!.localizedDescription)") - finished(nil) - } +// JoyGemAIManager.shared().device.getDN { deviceName in +// finished(deviceName) +// } error: { error in +// Logger.debug("获取dn失败","\(error!.localizedDescription)") +// finished(nil) +// } } else{ let dn = DeepChordsAiSdk.shared.getDeviceName() @@ -252,12 +252,12 @@ extension CCDevice{ } static func getVersion(finished:@escaping ((_ version:String?)->Void)) { if CCDevice.isJoy { - JoyGemAIManager.shared().device.software { version in - finished(version) - } error: { error in - Logger.debug("\(error!.localizedDescription)"); - finished(nil) - } +// JoyGemAIManager.shared().device.software { version in +// finished(version) +// } error: { error in +// Logger.debug("\(error!.localizedDescription)"); +// finished(nil) +// } } else{ DCDevice.shared.getSoftVersion {result in diff --git a/ShenYin/ShenYin/Sdk/CCPage.swift b/ShenYin/ShenYin/Sdk/CCPage.swift index a53d0ef..3272eab 100644 --- a/ShenYin/ShenYin/Sdk/CCPage.swift +++ b/ShenYin/ShenYin/Sdk/CCPage.swift @@ -8,7 +8,7 @@ class CCPage{ static func gotoChat(){ if CCDevice.isJoy { - App.shared.goToPage(JoyChatVC()) +// App.shared.goToPage(JoyChatVC()) } else{ App.shared.goToPage(DcChatVC()) @@ -16,7 +16,7 @@ class CCPage{ } static func gotoFieldRecord(){ if CCDevice.isJoy { - App.shared.goToPage(JoyXclyVC()) +// App.shared.goToPage(JoyXclyVC()) } else{ App.shared.goToPage(DcXclyVC()) @@ -24,12 +24,12 @@ class CCPage{ } static func gotoCallRecord(){ if CCDevice.isJoy { - if JoySdkManager.shared.callRecord.supportStereo{ - App.shared.goToPage(JoyStereoCallVC()) - } - else{ - App.shared.goToPage(JoyCallingRecordVC()) - } +// if JoySdkManager.shared.callRecord.supportStereo{ +// App.shared.goToPage(JoyStereoCallVC()) +// } +// else{ +// App.shared.goToPage(JoyCallingRecordVC()) +// } } else{ // if JoySdkManager.shared.callRecord.supportStereo{ @@ -42,7 +42,7 @@ class CCPage{ } static func gotoChinese2Enlgish(){ if CCDevice.isJoy { - App.shared.goToPage(JoyChinese2EnglishVC()) +// App.shared.goToPage(JoyChinese2EnglishVC()) } else{ App.shared.goToPage(DcChinese2EnglishVC()) @@ -50,7 +50,7 @@ class CCPage{ } static func gotoTcty(){ if CCDevice.isJoy { - App.shared.goToPage(JoyTctyVC()) +// App.shared.goToPage(JoyTctyVC()) } else{ App.shared.goToPage(DcTctyVC()) @@ -58,7 +58,7 @@ class CCPage{ } static func gotoDialogTranslate(){ if CCDevice.isJoy { - App.shared.goToPage(JoyDialogTranslateVC()) +// App.shared.goToPage(JoyDialogTranslateVC()) } else{ App.shared.goToPage(DcDialogTranslateVC()) diff --git a/ShenYin/ShenYin/Sdk/DcSdk/DcStereo.swift b/ShenYin/ShenYin/Sdk/DcSdk/DcStereo.swift index 7687035..8c64dee 100644 --- a/ShenYin/ShenYin/Sdk/DcSdk/DcStereo.swift +++ b/ShenYin/ShenYin/Sdk/DcSdk/DcStereo.swift @@ -46,9 +46,9 @@ class DcStereo:NSObject{ DCCallRecord.shared.filePathCallBack = { [weak self] path in guard let self = self else{return} Logger.debug("文件路径opus ==",path) - if selfText.isEmpty && otherText.isEmpty { - return - } +// if selfText.isEmpty && otherText.isEmpty { +// return +// } guard let path = path,path.isNotEmpty else{ return } diff --git a/ShenYin/StarburstSdk.framework/Headers/AIGCErrorCode.h b/ShenYin/StarburstSdk.framework/Headers/AIGCErrorCode.h new file mode 100644 index 0000000..3e98131 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/AIGCErrorCode.h @@ -0,0 +1,19 @@ +/** + * 图片生成任务错误码枚举 + */ +typedef NS_ENUM(NSInteger, AIGCErrorCode) { + /// 未授权访问 + AIGCErrorUnauthorized = 401, + /// 调用次数或资源超出配额限制 + AIGCErrorQuotaExceeded = 4001, + /// 无效的参数(如宽高非法) + AIGCErrorInvalidParam = -1, + /// 网络连接失败 + AIGCErrorNetworkFailure = -2, + /// 任务已被取消 + AIGCErrorTaskCanceled = -3, + /// 查询任务状态超时 + AIGCErrorQueryTimeout = -4, + /// 未知错误 + AIGCErrorUnknown = 9000 +}; diff --git a/ShenYin/StarburstSdk.framework/Headers/StarbaustVoiceChatModel.h b/ShenYin/StarburstSdk.framework/Headers/StarbaustVoiceChatModel.h new file mode 100644 index 0000000..e2b25cf --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarbaustVoiceChatModel.h @@ -0,0 +1,29 @@ +// +// StarbaustVoiceChatModel.h +// StarburstSdk +// +// Created by incar on 2024/11/22. +// + +#import +#import + +@interface StarbaustVoiceChatModel : NSObject +@property (nonatomic, assign) NSInteger code;/// 状态码,200成功 +@property (nonatomic, strong) NSString *msg;/// 提示语 +@property (nonatomic, strong) NSString *requestId;/// 请求id +@property (nonatomic, assign) NSInteger dialogId;/// 对话id +@property (nonatomic, assign) BOOL isAsrFinish;/// 识别是否已结束 +@property (nonatomic, strong) NSString *textResult;/// 语⾳识别结果⽚段内容 +@property (nonatomic, strong) NSString *responseText;/// 响应结果⽚段内容 +@property (nonatomic, strong) NSString *intent;/// 意图 +@property (nonatomic, assign) NSInteger sequence;/// 响应的编号 +@property (nonatomic, assign) BOOL definite;/// 语⾳识别结果⽚段是否已确定,后序不会有变化 +@property (nonatomic, assign) NSInteger definiteIndex;/// 已确定的识别结果序列号 +//@property (nonatomic, assign) NSInteger conversationIndex;/// 已确定的响应结果序列号 +@property (nonatomic, assign) BOOL conversationFinish;/// 对话是否结束 +@property (nonatomic, strong) StarburstTranslateResult *translateResult;///翻译结果 +@property (nonatomic, strong) StarburstAsrTtsResult *ttsResult;///tts音频流 +@property (nonatomic, assign) NSInteger playAudioSampleRate; +@end + diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstAsrConfig.h b/ShenYin/StarburstSdk.framework/Headers/StarburstAsrConfig.h new file mode 100644 index 0000000..c373b69 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstAsrConfig.h @@ -0,0 +1,105 @@ +// +// StarburstAsrConfig.h +// StarburstSdk +// +// Created by incar on 2024/9/14. +// + +#import + +//语言 +//简体中文 zh-CN +//四川话 sc +//粤语 cant +//上海话 zh_shanghai +//英文 en-US +//日语 ja-JP +//韩语 ko-KR +//法语 fr-FR +//西班牙语 es-MX +//葡萄牙语 pt-BR +//印尼语 id-ID +//俄语 ru-RU +//马来语 ms-MY + +/// voice chat配置 +@interface StarburstVoiceChatConfig : NSObject +@property (nonatomic, strong) NSString *role;/// 对话⻆⾊设定;默认为⽆特⾊的智能助⼿ +//@property (nonatomic, assign) int channel;/// 默认为1,只⽀持1:单声道、2:双声道 +@property (nonatomic, strong) NSString *language;/// 语⾔编码,默认为普通话(zh-CN) +@property (nonatomic, assign) BOOL tts;/// 是否进⾏Tts,默认false +@property (nonatomic, strong) NSString *ttsAudioFormat;/// 默认pcm。⽀持pcm / ogg_opus / mp3 +@property (nonatomic, strong) NSString *ttsSpeakerType;/// tts声⾊类型,仅当传"clone"时,ttsSpeaker为单⾊克隆⽣成的speakerId +@property (nonatomic, strong) NSString *ttsSpeakerId;/// tts声⾊设置,默认使⽤“⾃然⼥声” +@end + +/// 手机录音asr配置 +@interface StarburstAsrConfig : NSObject +/// 是否翻译,默认 false。如果为 true 翻译源语言和目标语言不能是同一种语言 +@property (nonatomic, assign) BOOL isTranslate; +/// 源语言编码,默认为普通话(zh-CN),auto_lang 自动识别 +@property (nonatomic, strong) NSString *fromLanguage; +/// 目标语言编码,默认为英语(en-US),auto_lang 自动识别 +@property (nonatomic, strong) NSString *toLanguage; +/// 左声道源语言编码;如果不设置,则使用 fromLanguage +@property (nonatomic, strong, nullable) NSString *leftFromLanguage; +/// 左声道目标语言编码;如果不设置,则使用 toLanguage +@property (nonatomic, strong, nullable) NSString *leftToLanguage; + +/// 右声道源语言编码;如果不设置,则使用 fromLanguage +@property (nonatomic, strong, nullable) NSString *rightFromLanguage; +/// 右声道目标语言编码;如果不设置,则使用 toLanguage +@property (nonatomic, strong, nullable) NSString *rightToLanguage; + +/// 是否进行 TTS,默认 false +@property (nonatomic, assign) BOOL isTTs; +/// TTS 输出格式,默认 pcm,支持 pcm / ogg_opus / mp3 +@property (nonatomic, strong) NSString *ttsFormat; +/// TTS 类型,默认只支持 "stream" +@property (nonatomic, strong) NSString *ttsType; +/// TTS 声色设置 +@property (nonatomic, strong) NSString *ttsSpeaker; +/// 音频封装格式(opus 原始流 raw,封装 ogg) +@property (nonatomic, strong) NSString *format; +/// 音频编码格式(opus、raw) +@property (nonatomic, strong) NSString *codec; +/// Opus 输入包大小(字节数) +@property (nonatomic, assign) NSInteger opusInputPackageSize; +/// Opus 输出包大小(字节数) +@property (nonatomic, assign) NSInteger opusOutputPackageSize; +/// 音频采样率,单位 Hz(例如:16000 或 48000) +@property (nonatomic, assign) NSInteger sampleRate; +/// 声道数(1 单声道,2 立体声) +@property (nonatomic, assign) NSInteger channels; +/// 说话人分离 +@property (nonatomic, assign) BOOL isSpeakerSeparate; +@end + +/// 蓝牙耳机录音asr配置 +@interface StarburstBleAsrConfig : NSObject +@property (nonatomic, assign) NSInteger type;/// 0x00实时录音,0x0c通话录音,其他待定 +@end + +/// 文件/文本asr配置 +@interface StarburstAsrFileConfig : NSObject +@property (nonatomic, assign) BOOL isTranslate;/// 是否翻译,默认false +@property (nonatomic, strong) NSString *fromLanguage;/// 语⾔编码 +@property (nonatomic, strong) NSString *toLanguage;/// ⽬标语⾔编码 +@property (nonatomic, assign) BOOL summary;/// 是否进行总结,默认false +/// 是否区分说话人,默认 NO +@property (nonatomic, assign) BOOL speakerSeparate; +/// 是否启用 ITN(数值/时间等标准化) +@property (nonatomic, assign) BOOL enableItn; +/// 端点检测窗口大小(VAD 终点判定),与服务端约定 +//@property (nonatomic, assign) NSInteger endWindowSize; // endWindowSize +/// 翻译增强,默认 NO +@property (nonatomic, assign) BOOL enableTranslateImprove; // enableTranslateImprove +@property (nonatomic, assign) BOOL speakerSplit;/// 是否区分说话人,默认false +@end + + +/// 翻译配置 +@interface StarburstTslConfig : NSObject +@property (nonatomic, strong) NSString *fromLanguage;/// 语⾔编码 +@property (nonatomic, strong) NSString *toLanguage;/// ⽬标语⾔编码 +@end diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstAsrModel.h b/ShenYin/StarburstSdk.framework/Headers/StarburstAsrModel.h new file mode 100644 index 0000000..6946bcd --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstAsrModel.h @@ -0,0 +1,60 @@ +// +// StarburstAsrModel.h +// StarburstSdk +// +// Created by incar on 2024/9/13. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 说话人分离结果(单段) +@interface StarburstSpeakerSegment : NSObject +@property (nonatomic, copy, nullable) NSString *speakerId; /// 说话人ID(字符串,如 "1") +@property (nonatomic, assign) NSInteger startTime; /// 起始时间(ms) +@property (nonatomic, assign) NSInteger endTime; /// 结束时间(ms) +@property (nonatomic, copy, nullable) NSString *text; /// 该段文本 +@property (nonatomic, assign) NSInteger definiteIndex; /// 该段确定序号 +/// 工厂方法 ++ (instancetype)modelWith:(NSDictionary *)dict; +@end + +/// 翻译结果 +@interface StarburstTranslateResult : NSObject +@property (nonatomic, copy, nullable) NSString *text; /// 语音识别后翻译的结果片段 +@property (nonatomic, assign) BOOL definite; /// 当前翻译片段是否确定 +@property (nonatomic, assign) int definiteIndex; /// 已翻译片段序号 +/// 工厂方法 ++ (instancetype)modelWith:(NSDictionary *)dict; +@end + +/// tts音频流 +@interface StarburstAsrTtsResult : NSObject +@property (nonatomic, assign) NSInteger index; /// 音频数据片段的序号 +@property (nonatomic, assign) NSInteger translateIndex; /// 翻译的序号 +@property (nonatomic, copy, nullable) NSString *streamPiece; /// 音频流(Base64/文本) ++ (instancetype)modelWith:(NSDictionary *)dict; +@end + +/// 识别结果 +@interface StarburstAsrModel : NSObject +@property (nonatomic, assign) NSInteger channel; /// 0非立体声,1左声道,2右声道 +@property (nonatomic, assign) NSInteger code; /// 状态码 +@property (nonatomic, copy, nullable) NSString *msg; /// 提示语 +@property (nonatomic, copy, nullable) NSString *requestId; /// 请求id +@property (nonatomic, copy, nullable) NSString *textResult; /// 语音识别结果片段内容 +@property (nonatomic, assign) NSInteger sequence; /// 响应的编号 +@property (nonatomic, assign) BOOL definite; /// 语音识别结果片段是否已确定,后序不会有变化 +@property (nonatomic, assign) NSInteger definiteIndex; /// 已确定的识别结果序列号 +@property (nonatomic, assign) BOOL isLastPackage; /// 是否为最后一包,后续没有数据(包括asr、tts、翻译结果) + +@property (nonatomic, strong, nullable) StarburstTranslateResult *translateResult; /// 翻译结果 +@property (nonatomic, strong, nullable) StarburstAsrTtsResult *ttsResult; /// tts音频流 + +@property (nonatomic, copy, nullable) NSArray *speakerResult; /// 说话人分离结果数组 + ++ (instancetype)modelWith:(NSDictionary *)dict; +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstConfig.h b/ShenYin/StarburstSdk.framework/Headers/StarburstConfig.h new file mode 100644 index 0000000..6d5cf98 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstConfig.h @@ -0,0 +1,44 @@ +// +// StarburstConfig.h +// StarburstSdk +// +// Created by liangshi on 2025/6/18. +// + +#import + +typedef NS_OPTIONS(NSInteger,StarburstSdkType) { + StarburstSdkType_Ble = 1,/// 设备鉴权+设备拾音(对话sdk内部封装耳机录音ble传输) + StarburstSdkType_Phone = 2,/// 账号鉴权+手机拾音(对话sdk内部封装手机录音) + StarburstSdkType_Mix = 3,/// 设备鉴权+手机拾音(对话sdk内部封装手机录音) + StarburstSdkType_Glasses_Ble = 4,/// 眼镜板+设备鉴权(对话需要外部喂音频流) + StarburstSdkType_Glasses_Account = 5,/// 眼镜板+账号鉴权(对话需要外部喂音频流) +}; + + +@interface StarburstConfig : NSObject +@property (nonatomic, readonly)NSString *logs;/// 获取日志 +@property (nonatomic, strong)void (^logCallback)(NSString *log);/// 日志输出回调 +@property (nonatomic, assign)BOOL isDebug;/// 是否打印日志,默认false +@property (nonatomic, strong)NSString *logPath;/// 日志路径,不设置不保存日志 +@property (nonatomic, strong)NSString *sdkFolder;/// sdk路径,可以自定义 +@property (nonatomic, strong)NSDictionary *debugInfo;/// 调试信息 +@property (nonatomic, strong)NSString *user_custom_prompt_init;/// voicechat配置 +@property (nonatomic, assign) CGFloat ttsSpeed;//默认1.0,范围[0.8,2] + +@property (nonatomic, assign)BOOL enableEarbudsSwitchSync;/// 主从耳机切换是否同步sdk信息到耳机,默认false +@property (nonatomic, assign)BOOL enableTextSyncToDevice;/// 是否下发文字到耳机仓,默认false +@property (nonatomic, assign)BOOL enableEmotionSyncToDevice;/// 耳机仓表情下发开关,默认false +@property (nonatomic, assign)BOOL enableSpeakerSeparate;/// 是否开启人话分离,默认false +@property (nonatomic, assign)NSInteger callRecordChannel;/// 通话录音声道数。1:单声道 ;2:⽴体声;默认单声道 +//enableExternalOpusDecoder +@property (nonatomic, strong)NSString *appId;/// 分配的id +@property (nonatomic, readonly)StarburstSdkType sdkType;/// sdk类型 + +/// 单利 ++ (instancetype)shared; + +/// 切换sdk +- (void)switchTo:(StarburstSdkType)type; +@end + diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstFileAsrModel.h b/ShenYin/StarburstSdk.framework/Headers/StarburstFileAsrModel.h new file mode 100644 index 0000000..b409f7b --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstFileAsrModel.h @@ -0,0 +1,36 @@ +// +// StarburstFileAsrModel.h +// StarburstSdk +// +// Created by incar on 2024/9/27. +// + +#import + +/// 该段说话人 +@interface StarburstFileAsrAdditions : NSObject +@property (nonatomic, strong) NSString *speaker;/// 该段说话人编号 +@end + +/// 识别片段 +@interface StarburstFileAsrPieces : NSObject +@property (nonatomic, strong) NSString *text;/// 片段识别的内筒 +@property (nonatomic, assign) NSInteger start_time;///片段对应文件进度,单位毫秒 +@property (nonatomic, assign) NSInteger end_time;/// 片段对应文件进度,单位毫秒 +@property (nonatomic, strong) StarburstFileAsrAdditions *additions;///该段说话人 +@end + +/// 文件识别结果模型 +@interface StarburstFileAsrModel : NSObject +@property (nonatomic, assign) NSInteger code;/// 状态码 +@property (nonatomic, strong) NSString *msg;/// 提示语 +@property (nonatomic, strong) NSString *requestId;/// 请求id +@property (nonatomic, strong) NSString *taskId;/// 任务id +@property (nonatomic, strong) NSString *text;/// 语⾳识别内容 +@property (nonatomic, strong) NSString *summary;/// 识别摘要内容 +@property (nonatomic, strong) NSString *transText;///识别后翻译结果 +@property (nonatomic, strong) NSArray *pieces;///识别片段 + ++ (StarburstFileAsrModel *)modelWith:(NSDictionary *)dict; +@end + diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstOffLineFile.h b/ShenYin/StarburstSdk.framework/Headers/StarburstOffLineFile.h new file mode 100644 index 0000000..9e7a192 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstOffLineFile.h @@ -0,0 +1,20 @@ +// +// StarburstOffLineFile.h +// StarburstSdk +// +// Created by incar on 2024/10/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 离线文件 +@interface StarburstOffLineFile : NSObject + +@property (nonatomic, assign) uint8_t fileType;/// 0x00所有文件、0x01左耳列表、0x02右耳列表 +@property (nonatomic, assign) NSInteger fileId;/// 文件id +@property (nonatomic, assign) NSInteger fileSize;/// 文件大小 +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstPhoneSdk.h b/ShenYin/StarburstSdk.framework/Headers/StarburstPhoneSdk.h new file mode 100644 index 0000000..f98d250 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstPhoneSdk.h @@ -0,0 +1,121 @@ +// +// StarburstPhoneSdk.h +// StarburstSdk +// +// Created by liangshi on 2025/3/11. +// + +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +@interface StarburstPhoneSdk : NSObject +@property (nonatomic, readonly)BOOL didAuth;/// 是否已经鉴权 +@property (nonatomic, strong)void (^websocketStateCallback)(BOOL connected);/// websocket状态回调,true为已连接,false未链接 + + +/// 单利 ++ (instancetype)shared; + +/// 注册 +/// - Parameters: +/// - productKey: 产品key +/// - productSecret: 产品秘钥,经过aes/cbc/7Padding加密后的data +/// - deviceName: 设备名称 +/// - random: 加密随机数 +/// - finished: 结果回调 +- (void)registerWithProductKey:(NSString *)productKey productSecret:(NSData *)productSecret deviceName:(NSString *)deviceName random:(NSString *)random finished:(void (^)(NSString *deviceSecret,NSError *error))finished; + +/// 登录 +/// - Parameters: +/// - productKey: 产品key +/// - deviceName: 设备名称 +/// - deviceSecret: 设备密码 +/// - finished: 结果回调 +- (void)connectWithProductKey:(NSString *)productKey deviceName:(NSString *)deviceName deviceSecret:(NSString *)deviceSecret finished:(void (^)(BOOL isSuccess,NSError *error))finished; + +///// 【文件摘要】 +///// - Parameters: +///// - path: 文件路径 +///// - recognize: 识别结果回调 +///// - error: 错误回调 +//- (void)asrByFile:(NSURL *)filePath config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本摘要】 +/// - Parameters: +/// - text: 识别的文本 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)summaryByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本摘要】--流式 +/// - Parameters: +/// - text: 摘要的文字 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)summaryByTextWithSplit:(NSString *)text recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本摘要】--流式 +-(void)cancelSummaryByTextWithSplit; + +/// 【文本翻译】 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)translateByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本翻译】--流式 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)translateByTextWithSplit:(NSString *)text config:(StarburstTslConfig*)config recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本翻译】--流式 +-(void)cancelTranslateByTextWithSplit; + +/// 【同声传译】开始手机拾音 +/// - Parameters: +/// - config: 识别配置 +/// - voiceRecordData: 录音音频流回调 +/// - recognizeText: 识别回调 +/// - stateChange: 状态回调 +- (void)startRecordAsr:(StarburstAsrConfig*)config voiceRecord:(void (^)(NSData*))voiceData recognizeText:(void (^)(StarburstAsrModel*))recognize stateChange:(void(^)(StarburstCode code))stateChange interruption:(void(^)(void))interrupt; + +/// 【同声传译】结束手机拾音 +/// - Parameter fileCallback: 录音文件回调 +- (void)stopRecordAsr:(void(^)(NSString *filePath))fileCallback; + +/// 手机拾音对话设置 +/// - Parameters: +/// - config: 对话配置 +/// - startCallBack: 开始回调 +/// - textCallBack: 文本识别回调 +/// - voiceCallBack: AI语音回复回调 +/// - stateChange: 状态回调 +/// - finished:录音地址回调 +- (void)setupPhoneChatWith:(StarburstVoiceChatConfig*)config start:(void (^)(NSInteger dialogId))startCallback textCallback:(void (^)(StarbaustVoiceChatModel*))textCallBack responseVoice:(void (^)(NSInteger dialogId,NSData*data,BOOL finish,NSInteger sampleRate))voiceCallBack stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; + +/// 手机拾音,开始对话 +/// - Parameter vadType: 0 vad检测,1不启用vad(手动控制开始/结束讲话) +- (void)startPhoneChat:(int)vadType; + +/// 结束手机拾音对话 +- (void)stopPhoneChat; + +/// 获取音色列表 +/// - Parameter callBack: 结果回调 +- (void)getVcSpeekerList:(void (^)(NSArray *list,BOOL success))callBack; + +@end + diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstSdk.h b/ShenYin/StarburstSdk.framework/Headers/StarburstSdk.h new file mode 100644 index 0000000..fb26542 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstSdk.h @@ -0,0 +1,36 @@ +// +// Starburst.h +// Starburst +// +// Created by cookies on 2023/6/12. +// + +#import + +//! Project version number for Starburst. +//FOUNDATION_EXPORT double StarburstSdkVersionNumber; + +//! Project version string for Starburst. +//FOUNDATION_EXPORT const unsigned char StarburstSdkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstSdkManager.h b/ShenYin/StarburstSdk.framework/Headers/StarburstSdkManager.h new file mode 100644 index 0000000..1aa3a71 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstSdkManager.h @@ -0,0 +1,195 @@ +// +// StarburstSdk.h +// VoiceDemo +// +// Created by incar on 2024/9/12. +// + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +typedef NS_OPTIONS(NSInteger,StarburstCode) { + StarburstCode_Start_Record = 20001,///开始录音 + StarburstCode_Stop_Record = 20002,///停止录音 + StarburstCode_Record_Error = 20003,///录音出错 + StarburstCode_Ble_Disconected = 20004,///蓝牙断开 + StarburstCode_Websocket_Connected = 30001,///socket连上 + StarburstCode_Websocket_Disconnected = 30002,///socket断开连接 + StarburstCode_Websocket_Connecting = 30003,///socket连接中... + StarburstCode_Websocket_pingTimeOut = 30004,///ping超时 + StarburstCode_Net_Error = 50000,///网络错误 + StarburstCode_UnAuth = 60000,///未鉴权 +}; + +typedef void (^AudioIntensityInputCallback)(NSArray *left, + NSArray *right, + NSTimeInterval timestampMs); + +@interface StarburstSdk : NSObject +//@property (nonatomic, strong)void (^authSuccessCallback)(void);/// 鉴权成功回调 +@property (nonatomic, strong)void (^authCallback)(int code,NSString *msg);/// 鉴权结果回调,code200代表成功,其他为失败 +@property (nonatomic, readonly)BOOL didAuth;// 是否已经鉴权 +@property (nonatomic, strong)void (^websocketStateCallback)(BOOL connected);/// websocket状态回调,true为已连接,false未链接 +@property (nonatomic, strong)void (^bleRecordStateCallback)(int state);/// 耳机录音状态回调,1录音,2结束录音 +@property (nonatomic, strong)void (^sendToBleCallback)(NSData *data);/// 发送给蓝牙设备 + +/// 单利 ++ (instancetype)shared; + +/// 收到蓝牙设备传过来的数据,交给sdk处理 +/// - Parameter data:数据 +- (void)receiveBleData:(NSData *)data; + +/// 蓝牙设备已经连上(蓝牙连接和断开都需要通知sdk) +- (void)bleConnected; + +/// 蓝牙断开连接(在监听到蓝牙断开的时候,调用该方法通知sdk结束当前任务) +- (void)bleDisConnected; + +///// 【文本摘要】 +///// - Parameters: +///// - text: 识别的文本 +///// - recognize: 识别结果回调 +///// - error: 错误回调 +- (void)summaryByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本摘要】--流式 +/// - Parameters: +/// - text: 摘要的文字 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)summaryByTextWithSplit:(NSString *)text recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本摘要】--流式 +-(void)cancelSummaryByTextWithSplit; + +/// 【文本翻译】 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)translateByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本翻译】--流式 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)translateByTextWithSplit:(NSString *)text config:(StarburstTslConfig*)config recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + + +/// 取消 【文本翻译】--流式 +-(void)cancelTranslateByTextWithSplit; + +/// 【同声传译】开始手机拾音 +/// - Parameters: +/// - config: 识别配置 +/// - voiceRecordData: 录音音频流回调 +/// - recognizeText: 识别回调 +/// - stateChange: 状态回调 +/// - interrupt:打断回调(接听电话等打断) +- (void)startRecordAsr:(StarburstAsrConfig*)config voiceRecord:(void (^)(NSData*))voiceData recognizeText:(void (^)(StarburstAsrModel*))recognize stateChange:(void(^)(StarburstCode code))stateChange interruption:(void(^)(void))interrupt; + +/// 【同声传译】结束手机拾音 +/// - Parameter fileCallback: 录音文件回调 +- (void)stopRecordAsr:(void(^)(NSString *filePath))callback; + +/// 【自定义音频流识别】开始 +/// - Parameters: +/// - config: ASR识别配置(和手机拾音配置一致) +/// - recognize: 文本识别结果回调 +/// - stateChange: 状态变化回调 +- (void)startCustomAsr:(StarburstAsrConfig*)config + recognizeText:(void (^)(StarburstAsrModel *model))recognize + stateChange:(void(^)(StarburstCode code))stateChange; + +/// 【自定义音频流识别】发送音频数据 +/// - Parameter data: 外部采集的音频 PCM 或其他格式(根据 config 设定) +- (void)sendCustomAudioData:(NSData *)data; + +/// 【自定义音频流识别】结束 +- (void)stopCustomAsr; + +/// 开始耳机拾音 +/// - Parameters: +/// - config: 识别配置 +- (void)startDeviceRecord:(StarburstBleAsrConfig*)config; + +/// 结束耳机拾音 +- (void)stopDeviceRecord; + +/// 设置耳机拾音回调 +/// - Parameters: +/// - recordPath: 录音文件保存的路径。如果文件已经存在,则音频数据会追加到尾部;如果不存在,则创建新文件;传nil则会按之前时间格式创建新文件 +/// - asrConfig: 识别配置 +/// - bleConfig: 耳机录音类型回调 +/// - recognize: 识别回调 +/// - stateChange: 状态回调 +/// - path: 录音结束,录音文件地址回调 +- (void)setupDeviceRecordWith:(NSString *)recordPath asrConfig:(StarburstAsrConfig*)asrConfig bleConfig:(void (^)(StarburstBleAsrConfig*))bleConfig recognizeText:(void (^)(StarburstAsrModel*))recognize stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; + + +/// opus输出给app,app解码后将数据通过inputPcmData传回给sdk +- (void)outputOpusData:(void (^)(StartburstDecoderConfig *copusConfig,NSData*opusData))recordCallBack; + +/// opus解码后传给sdk +- (void)inputPcmData:(NSData *)pcmData; + + + + + +/// 获取音色列表 +/// - Parameter callBack: 结果回调 +- (void)getVcSpeekerList:(void (^)(NSArray *list,BOOL success))callBack; + +/// 设置voice chat回调,目前只支持蓝牙设备发起对话 +/// - Parameters: +/// - config: 对话配置 +/// - startCallBack: 开始回调 +/// - textCallBack: 文本识别回调 +/// - voiceCallBack: AI语音回复回调 +/// - stateChange: 状态回调 +/// - finished:录音地址回调 +- (void)setupVoiceChatWith:(StarburstVoiceChatConfig*)config start:(void (^)(NSInteger dialogId))startCallback textCallback:(void (^)(StarbaustVoiceChatModel*))textCallBack responseVoice:(void (^)(NSInteger dialogId,NSData*data,BOOL finish, NSInteger sampleRate))voiceCallBack stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; + +/// 终止voice chat对话 +- (void)stopVoiceChat:(NSInteger)dialogId; + +/// 开始播放tts +- (void)startPlayTtsAudio:(NSInteger)dialogId; + +/// 结束播放tts +- (void)stopPlayTtsAudio:(NSInteger)dialogId; + +/// 发送文字对话 +/// - Parameters: +/// - text: 对话的文字 +/// - isTts: 是否tts +- (void)sendVoiceChat:(NSString *)text tts:(BOOL)isTts; + + +//不可用 +- (void)setupPhoneChatWith:(StarburstVoiceChatConfig*)config start:(void (^)(NSInteger dialogId))startCallback textCallback:(void (^)(StarbaustVoiceChatModel*))textCallBack responseVoice:(void (^)(NSInteger dialogId,NSData*data,BOOL finish,NSInteger sampleRate))voiceCallBack stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; +//不可用 +- (void)startPhoneChat:(int)vadType; +//不可用 +- (void)stopPhoneChat; +//不可用 +- (void)registerWithProductKey:(NSString *)productKey productSecret:(NSString *)productSecret deviceName:(NSString *)deviceName random:(NSString *)random finished:(void (^)(NSString *deviceSecret,NSError *error))finished; +//不可用 +- (void)connectWithProductKey:(NSString *)productKey deviceName:(NSString *)deviceName deviceSecret:(NSString *)deviceSecret finished:(void (^)(BOOL isSuccess,NSError *error))finished; +- (void)setInputAudioIntensityCallback:(AudioIntensityInputCallback)callback; + +-(NSString *)getDeviceName; +@end + diff --git a/ShenYin/StarburstSdk.framework/Headers/StarburstStreamModel.h b/ShenYin/StarburstSdk.framework/Headers/StarburstStreamModel.h new file mode 100644 index 0000000..fa0ad1f --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarburstStreamModel.h @@ -0,0 +1,20 @@ +// +// StarburstStreamModel.h +// StarburstSdk +// +// Created by liangshi on 2024/12/20. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface StarburstStreamModel : NSObject +@property (nonatomic, assign) NSInteger code;//1: processing, 10: complete -1:fail +@property (nonatomic, strong) NSString *msg;//提示文字 +@property (nonatomic, strong) NSString *failReason;//失败原因 +@property (nonatomic, strong) NSString *llmResponse;// 增量返回的⽂本内容 +@property (nonatomic, assign) BOOL complete;// ⽂本内容是否完成 +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/StarburstSdk.framework/Headers/StarbusrtSpeaker.h b/ShenYin/StarburstSdk.framework/Headers/StarbusrtSpeaker.h new file mode 100644 index 0000000..2b2dae4 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StarbusrtSpeaker.h @@ -0,0 +1,19 @@ +// +// StarbusrtSpeaker.h +// StarburstSdk +// +// Created by liangshi on 2025/2/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface StarbusrtSpeaker : NSObject +@property (nonatomic, strong) NSString *sid;/// 音色id +@property (nonatomic, strong) NSString *name;/// 名称 +@property (nonatomic, strong) NSString *type;/// 类型 +@property (nonatomic, strong) NSString *role;/// 角色 +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/StarburstSdk.framework/Headers/StartburstDecoderConfig.h b/ShenYin/StarburstSdk.framework/Headers/StartburstDecoderConfig.h new file mode 100644 index 0000000..7e47aa2 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StartburstDecoderConfig.h @@ -0,0 +1,18 @@ +//// +//// Startburst.h +//// StarburstSdk +//// +//// Created by liangshi on 2025/6/11. +//// +// +#import + +@interface StartburstDecoderConfig : NSObject +@property (nonatomic, assign)NSInteger sampleRate;/// 采样率 +@property (nonatomic, assign)NSInteger numChannels;/// 声道数 +@property (nonatomic, assign)NSInteger encodedFrameLength;/// 编码后每帧字节数 +@property (nonatomic, assign)NSInteger originalSamplesPerFrame;/// 编码前每帧采样点数 +@property (nonatomic, assign)NSInteger bitDepth;/// 采样位深(16/24/32) +@end + + diff --git a/ShenYin/StarburstSdk.framework/Headers/StartburstGlassChat.h b/ShenYin/StarburstSdk.framework/Headers/StartburstGlassChat.h new file mode 100644 index 0000000..e3f6a1b --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StartburstGlassChat.h @@ -0,0 +1,49 @@ +// +// StartburstGlassChat.h +// StarburstSdk +// +// Created by liangshi on 2025/5/6. +// + +#import +#import +#import +#import + + +@interface StartburstGlassChat : NSObject +/// +/// 对话设置 +/// - Parameters: +/// - config: 对话配置 +/// - textCallBack: 文本识别回调 +/// - voiceCallBack: AI语音回复回调 +/// - stateChange: 状态回调 +/// - finished:录音地址回调 +- (void)setupPhoneChatWith:(StarburstVoiceChatConfig*)config textCallback:(void (^)(StarbaustVoiceChatModel*))textCallBack responseVoice:(void (^)(NSInteger dialogId,NSData*data,BOOL finish,NSInteger sampleRate))voiceCallBack stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; + +/// 开始对话 +- (void)start; + +/// 结束对话 +- (void)stop; + +/// 分发数据 +/// - Parameter data:音频流 +- (void)fireAudioData:(NSData *)data; + +/// 通知vad状态变化 +/// - Parameter isVadStarted: ture表⽰vad检测到说话开始,false表⽰vad检测到说话结束 +- (void)vadStateChange:(BOOL)isVadStarted; + +/// 分发数据 +/// - Parameter data:图片流 +- (void)fireImageData:(NSData *)data; + +/// 分发数据 +/// - Parameter text:文本 +- (void)fireText:(NSString *)text; + +@end + + diff --git a/ShenYin/StarburstSdk.framework/Headers/StartburstGlassesSdk.h b/ShenYin/StarburstSdk.framework/Headers/StartburstGlassesSdk.h new file mode 100644 index 0000000..e3f6eba --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StartburstGlassesSdk.h @@ -0,0 +1,122 @@ +// +// StartburstGlassesSdk.h +// StarburstSdk +// +// Created by liangshi on 2025/4/29. +// + + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@interface StartburstGlassesSdk : NSObject +@property (nonatomic, strong)void (^sendToBleCallback)(NSData *data);/// 发送给蓝牙设备 +@property (nonatomic, strong)void (^authCallback)(int code,NSString *msg);/// 鉴权结果回调,code200代表成功,其他为失败 +@property (nonatomic, readonly)BOOL didAuth;/// 是否已经鉴权 +@property (nonatomic, strong)StartburstGlassChat *chat;/// 对话对象 + +/// 单利 ++ (instancetype)shared; + +/// 收到蓝牙设备传过来的数据,交给sdk处理 +/// - Parameter data:数据 +- (void)receiveBleData:(NSData *)data; + +/// 蓝牙设备已经连上 +- (void)bleConnected; + +/// 蓝牙断开连接(在监听到蓝牙断开的时候,调用该方法通知sdk结束当前任务) +- (void)bleDisConnected; + +/// 注册 +/// - Parameters: +/// - productKey: 产品key +/// - productSecret: 产品秘钥,经过aes/cbc/7Padding加密后的data +/// - deviceName: 设备名称 +/// - random: 加密随机数 +/// - finished: 结果回调 +- (void)registerWithProductKey:(NSString *)productKey productSecret:(NSData *)productSecret deviceName:(NSString *)deviceName random:(NSString *)random finished:(void (^)(NSString *deviceSecret,NSError *error))finished; + +/// 登录 +/// - Parameters: +/// - productKey: 产品key +/// - deviceName: 设备名称 +/// - deviceSecret: 设备密码 +/// - finished: 结果回调 +- (void)connectWithProductKey:(NSString *)productKey deviceName:(NSString *)deviceName deviceSecret:(NSString *)deviceSecret finished:(void (^)(BOOL isSuccess,NSError *error))finished; + +/// 【文本摘要】 +/// - Parameters: +/// - text: 识别的文本 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)summaryByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本摘要】--流式 +/// - Parameters: +/// - text: 摘要的文字 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)summaryByTextWithSplit:(NSString *)text recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本摘要】--流式 +-(void)cancelSummaryByTextWithSplit; + +/// 【文本翻译】 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)translateByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本翻译】--流式 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)translateByTextWithSplit:(NSString *)text config:(StarburstTslConfig*)config recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本翻译】--流式 +-(void)cancelTranslateByTextWithSplit; + +/// 【同声传译】开始手机拾音 +/// - Parameters: +/// - config: 识别配置 +/// - voiceRecordData: 录音音频流回调 +/// - recognizeText: 识别回调 +/// - stateChange: 状态回调 +- (void)startRecordAsr:(StarburstAsrConfig*)config voiceRecord:(void (^)(NSData*))voiceData recognizeText:(void (^)(StarburstAsrModel*))recognize stateChange:(void(^)(StarburstCode code))stateChange interruption:(void(^)(void))interrupt; + +/// 【同声传译】结束手机拾音 +/// - Parameter fileCallback: 录音文件回调 +- (void)stopRecordAsr:(void(^)(NSString *filePath))fileCallback; + + +/// 开始自定义音频流识别 +- (void)startCustomAsr:(StarburstAsrConfig*)config + recognizeText:(void (^)(StarburstAsrModel *model))recognize + stateChange:(void(^)(StarburstCode code))stateChange; + +/// 发送一段自定义音频数据(采样率、格式需匹配 config 设定) +- (void)sendCustomAudioData:(NSData *)data; + +/// 停止自定义音频流识别 +- (void)stopCustomAsr; + +/// 获取音色列表 +/// - Parameter callBack: 结果回调 +- (void)getVcSpeekerList:(void (^)(NSArray *list,BOOL success))callBack; + +@end + + diff --git a/ShenYin/StarburstSdk.framework/Headers/StartburstMixSdk.h b/ShenYin/StarburstSdk.framework/Headers/StartburstMixSdk.h new file mode 100644 index 0000000..456b341 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/StartburstMixSdk.h @@ -0,0 +1,111 @@ +// +// StartburstMixSdk.h +// StarburstSdk +// +// Created by liangshi on 2025/4/22. +// + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@interface StartburstMixSdk : NSObject + +@property (nonatomic, strong)void (^authCallback)(int code,NSString *msg);/// 鉴权结果回调,code200代表成功,其他为失败 +@property (nonatomic, readonly)BOOL didAuth;/// 是否已经鉴权 +@property (nonatomic, strong)void (^websocketStateCallback)(BOOL connected);/// websocket状态回调,true为已连接,false未链接 +@property (nonatomic, strong)void (^sendToBleCallback)(NSData *data);/// 发送给蓝牙设备 + +/// 单利 ++ (instancetype)shared; + +/// 收到蓝牙设备传过来的数据,交给sdk处理 +/// - Parameter data:数据 +- (void)receiveBleData:(NSData *)data; + +/// 蓝牙设备已经连上 +- (void)bleConnected; + +/// 蓝牙断开连接(在监听到蓝牙断开的时候,调用该方法通知sdk结束当前任务) +- (void)bleDisConnected; + + +/// 【文本摘要】 +/// - Parameters: +/// - text: 识别的文本 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)summaryByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本摘要】--流式 +/// - Parameters: +/// - text: 摘要的文字 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)summaryByTextWithSplit:(NSString *)text recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本摘要】--流式 +-(void)cancelSummaryByTextWithSplit; + +/// 【文本翻译】 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 识别结果回调 +/// - error: 错误回调 +- (void)translateByText:(NSString *)text config:(StarburstAsrFileConfig*)config recognizeText:(void (^)(StarburstFileAsrModel*))recognize error:(void (^)(NSError *err))error; + +/// 【文本翻译】--流式 +/// - Parameters: +/// - text: 翻译的文字 +/// - config: 翻译配置 +/// - recognize: 结果回调 +/// - error: 错误回调 +- (void)translateByTextWithSplit:(NSString *)text config:(StarburstTslConfig*)config recognizeText:(void (^)(StarburstStreamModel*))recognize error:(void (^)(NSError *err))error; + +/// 取消 【文本翻译】--流式 +-(void)cancelTranslateByTextWithSplit; + +/// 【同声传译】开始手机拾音 +/// - Parameters: +/// - config: 识别配置 +/// - voiceRecordData: 录音音频流回调 +/// - recognizeText: 识别回调 +/// - stateChange: 状态回调 +- (void)startRecordAsr:(StarburstAsrConfig*)config voiceRecord:(void (^)(NSData*))voiceData recognizeText:(void (^)(StarburstAsrModel*))recognize stateChange:(void(^)(StarburstCode code))stateChange interruption:(void(^)(void))interrupt; + +/// 【同声传译】结束手机拾音 +/// - Parameter fileCallback: 录音文件回调 +- (void)stopRecordAsr:(void(^)(NSString *filePath))fileCallback; + +/// 手机拾音对话设置 +/// - Parameters: +/// - config: 对话配置 +/// - startCallBack: 开始回调 +/// - textCallBack: 文本识别回调 +/// - voiceCallBack: AI语音回复回调 +/// - stateChange: 状态回调 +/// - finished:录音地址回调 +- (void)setupPhoneChatWith:(StarburstVoiceChatConfig*)config start:(void (^)(NSInteger dialogId))startCallback textCallback:(void (^)(StarbaustVoiceChatModel*))textCallBack responseVoice:(void (^)(NSInteger dialogId,NSData*data,BOOL finish, NSInteger sampleRate))voiceCallBack stateChange:(void(^)(StarburstCode code))stateChange finished:(void(^)(NSString *filePath))path; + + +/// 手机拾音,开始对话 +/// - Parameter vadType: 0 vad检测,1不启用vad +- (void)startPhoneChat:(int)vadType; + +/// 结束手机拾音对话 +- (void)stopPhoneChat; + +/// 获取音色列表 +/// - Parameter callBack: 结果回调 +- (void)getVcSpeekerList:(void (^)(NSArray *list,BOOL success))callBack; + +@end + + diff --git a/ShenYin/StarburstSdk.framework/Headers/TextToImageCallback.h b/ShenYin/StarburstSdk.framework/Headers/TextToImageCallback.h new file mode 100644 index 0000000..f5e9bfe --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/TextToImageCallback.h @@ -0,0 +1,51 @@ +#import +#import + +/** + * 文本生成图片回调协议 + * + * 实现此协议可接收任务创建、进度、成功、失败、取消等事件。 + */ +@protocol TextToImageCallback + +/** + * 当任务创建成功时触发 + * + * @param taskId 唯一任务标识 + */ +- (void)onCreated:(NSString *)taskId; + +/** + * 当任务处于进行状态时触发 + * + * @param taskId 任务标识 +*/ +- (void)onProcessing:(NSString *)taskId; + + +/** + * 当任务成功生成图片时触发 + * + * @param taskId 任务标识 + * @param images 生成图片的 URL 数组(NSString 类型) + */ +- (void)onSuccess:(NSString *)taskId images:(NSArray *)images; + +/** + * 当任务发生错误时触发 + * + * @param taskId 任务标识 + * @param code 错误码(AIGCErrorCode) + * @param message 错误说明 + */ +- (void)onError:(NSString *)taskId code:(AIGCErrorCode)code message:(NSString *)message; + +/** + * 当任务被取消时触发 + * + * @param taskId 任务标识 + * @param success YES 表示取消成功,NO 表示取消失败 + */ +- (void)onCanceled:(NSString *)taskId success:(BOOL)success; + +@end diff --git a/ShenYin/StarburstSdk.framework/Headers/TextToImageManager.h b/ShenYin/StarburstSdk.framework/Headers/TextToImageManager.h new file mode 100644 index 0000000..e2c3811 --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/TextToImageManager.h @@ -0,0 +1,73 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TextToImageManager : NSObject + +/** + * 获取单例实例 + * + * @return TextToImageManager 单例对象 + */ ++ (instancetype)sharedInstance; + +/** + * 创建图片生成任务并自动轮询任务状态直到完成 + * + * @param prompt 文本提示词,例如“阳光下的海边风景” + * @param imageCount 生成的图片数量,建议范围 1~4 + * @param imageWidth 生成图片的宽度(像素) + * @param imageHeight 生成图片的高度(像素) + * @param callback 实现了 TextToImageCallback 协议的回调对象,用于接收任务事件 + * + * @discussion 调用此方法会创建任务并自动定时查询任务进度, + * 直到任务完成(成功或失败)或被取消。 + */ +- (void)startTextToImage:(NSString *)prompt + imageCount:(NSInteger)imageCount + imageWidth:(NSInteger)imageWidth + imageHeight:(NSInteger)imageHeight + callback:(id)callback + NS_SWIFT_NAME(startTextToImage(prompt:imageCount:imageWidth:imageHeight:callback:)); + +/** + * 按任务 ID 持续轮询任务状态 + * + * @param taskId 已创建任务的唯一标识 + * @param callback 回调对象,用于接收任务状态和结果 + * + * @discussion 会持续查询任务状态直到任务完成,不会重新创建任务。 + */ +- (void)queryByTaskId:(NSString *)taskId callback:(id)callback; + +/** + * 按任务 ID 查询一次任务状态 + * + * @param taskId 已创建任务的唯一标识 + * @param callback 回调对象 + * + * @discussion 与 queryByTaskId 不同,此方法只查询一次,不进行持续轮询。 + */ +- (void)queryOnceByTaskId:(NSString *)taskId + callback:(id)callback + NS_SWIFT_NAME(queryOnceByTaskId(_:callback:)); + +/** + * 取消指定的图片生成任务 + * + * @param taskId 要取消的任务 ID + */ +- (void)cancelTextToImage:(NSString *)taskId; + +/** + * 取消所有正在运行的图片生成任务 + */ +- (void)cancelAllTasks; + +/// 释放全部资源(不取消正运行任务) +- (void)releaseResources; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/StarburstSdk.framework/Headers/TextToSpeechCallback.h b/ShenYin/StarburstSdk.framework/Headers/TextToSpeechCallback.h new file mode 100644 index 0000000..de8d95c --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/TextToSpeechCallback.h @@ -0,0 +1,37 @@ +#import + +/** + * 文本转语音回调协议 + * + * 客户端实现此协议,用于接收 TTS(Text To Speech)服务的结果或错误信息。 + */ +@protocol TextToSpeechCallback + +@required + +/** + * 当云端成功返回语音数据(或语音下载地址等)时回调 + * + * @param response 云端返回的完整响应字符串,通常为 JSON 格式或语音文件的 URL。 + * + * @discussion 调用方可以在此方法中解析响应内容,例如: + * - 获取语音文件下载地址 + * - 获取 Base64 编码的音频数据 + */ +- (void)onResult:(NSString *)response; + +/** + * 当调用 TTS 服务发生错误时回调 + * + * @param code 错误码(整数),具体含义由服务端定义 + * @param message 错误提示信息,便于问题排查 + * + * @discussion 常见错误: + * - 网络连接失败 + * - 请求参数错误 + * - 服务端内部错误 + * - 授权失败 + */ +- (void)onError:(NSInteger)code message:(NSString *)message; + +@end diff --git a/ShenYin/StarburstSdk.framework/Headers/TextToSpeechManager.h b/ShenYin/StarburstSdk.framework/Headers/TextToSpeechManager.h new file mode 100644 index 0000000..81ae05c --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Headers/TextToSpeechManager.h @@ -0,0 +1,51 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * 文本转语音管理器 + * + * 封装了调用云端 TTS(Text To Speech)接口的过程, + * 支持设置语速、音色等参数,将文本合成成语音数据。 + */ +@interface TextToSpeechManager : NSObject + +/** + * 获取单例对象 + * + * @return TextToSpeechManager 单例实例 + * + * @discussion 建议全局共享此管理器实例,避免重复创建和释放网络资源。 + */ ++ (instancetype)sharedInstance; + +/** + * 调用文本转语音服务 + * + * @param companyId 企业或应用 ID(由服务方分配,用于鉴权) + * @param text 待合成的文本内容 + * @param reqId 请求唯一标识,用于排查日志或防重复请求 + * @param speedRatio 合成语音的语速倍率(1.0 为正常语速,>1.0 为加快,<1.0 为减慢) + * @param voiceType 音色类型标识(例如 "zh_female_qingchezizi_moon_bigtts") + * @param encoding 音频编码格式(如 "pcm"、"mp3"、"wav"),可为 nil 使用默认编码 + * @param callback 回调对象,须实现 TextToSpeechCallback 协议,用于接收结果或错误 + * + * @discussion 此方法会向云端发送 TTS 请求,云端返回后通过 callback 通知调用方。 + * 建议: + * - 确保 text 不超过服务端最大长度限制 + * - speedRatio 和 voiceType 需符合云端支持范围 + * - callback 在主线程回调,可直接更新 UI 或播放音频 + */ +- (void)textToSpeech:(NSString *)companyId + text:(NSString *)text + reqId:(NSString *)reqId + speedRatio:(float)speedRatio + voiceType:(NSString *)voiceType + encoding:(nullable NSString *)encoding + callback:(id)callback +NS_SWIFT_NAME(textToSpeech(companyId:text:reqId:speedRatio:voiceType:encoding:callback:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ShenYin/JoyGemAI.framework/Info.plist b/ShenYin/StarburstSdk.framework/Info.plist similarity index 54% rename from ShenYin/JoyGemAI.framework/Info.plist rename to ShenYin/StarburstSdk.framework/Info.plist index 3374824..5cd3e36 100644 Binary files a/ShenYin/JoyGemAI.framework/Info.plist and b/ShenYin/StarburstSdk.framework/Info.plist differ diff --git a/ShenYin/StarburstSdk.framework/Modules/module.modulemap b/ShenYin/StarburstSdk.framework/Modules/module.modulemap new file mode 100644 index 0000000..7426ade --- /dev/null +++ b/ShenYin/StarburstSdk.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module StarburstSdk { + umbrella header "StarburstSdk.h" + export * + + module * { export * } +} diff --git a/ShenYin/JoyGemAI.framework/PrivacyInfo.xcprivacy b/ShenYin/StarburstSdk.framework/PrivacyInfo.xcprivacy similarity index 100% rename from ShenYin/JoyGemAI.framework/PrivacyInfo.xcprivacy rename to ShenYin/StarburstSdk.framework/PrivacyInfo.xcprivacy diff --git a/ShenYin/StarburstSdk.framework/StarburstSdk b/ShenYin/StarburstSdk.framework/StarburstSdk new file mode 100644 index 0000000..fed75fa Binary files /dev/null and b/ShenYin/StarburstSdk.framework/StarburstSdk differ diff --git a/ShenYin/StarburstSdk.framework/_CodeSignature/CodeDirectory b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeDirectory new file mode 100644 index 0000000..0cc28a0 Binary files /dev/null and b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeDirectory differ diff --git a/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements new file mode 100644 index 0000000..4b131e2 Binary files /dev/null and b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements differ diff --git a/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements-1 b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements-1 new file mode 100644 index 0000000..b5e14ee Binary files /dev/null and b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeRequirements-1 differ diff --git a/ShenYin/StarburstSdk.framework/_CodeSignature/CodeResources b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..17c777d --- /dev/null +++ b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeResources @@ -0,0 +1,432 @@ + + + + + files + + Headers/AIGCErrorCode.h + + 6X+BFAl1GUlE673wijlbbmSDK7o= + + Headers/StarbaustVoiceChatModel.h + + O8K7t0c5zyFzqsMRLB06Q9rMy98= + + Headers/StarburstAsrConfig.h + + tSk0X4yTu1hQB88SVtxWkHcfTRY= + + Headers/StarburstAsrModel.h + + YMyp9i53bEO3diakJf+v5x2v2a0= + + Headers/StarburstConfig.h + + s3KYCCc8Cq0RWmlyfW7qe20T0c8= + + Headers/StarburstFileAsrModel.h + + KCay85nepjWFLxW32vUBaknoYTk= + + Headers/StarburstOffLineFile.h + + 28IGQ1ND/MHAAnUNKNBxuvS5ROc= + + Headers/StarburstPhoneSdk.h + + rwT9UO4f4YJAdgYM9SUrQo6cW0M= + + Headers/StarburstSdk.h + + aWY4JErrzMt9gCv0UqKyp5t+qGM= + + Headers/StarburstSdkManager.h + + qhZrrBq0fWMMexpfZdAUj4ZVVNg= + + Headers/StarburstStreamModel.h + + cdW3VKYRIjOHM5xn0Zzt3fioFro= + + Headers/StarbusrtSpeaker.h + + SBlLEersGuEueZNxVNc2uyepfts= + + Headers/StartburstDecoderConfig.h + + CEyiYJhRwvumcRqNLLoJARHeU24= + + Headers/StartburstGlassChat.h + + EKmAva0NghWkD5BgB3v2JyOqcQo= + + Headers/StartburstGlassesSdk.h + + zjj7I7WFlFcTzkseAMNaUZyEIyI= + + Headers/StartburstMixSdk.h + + CLg1FGxHPySPI5qCJH4N1zAZIw4= + + Headers/TextToImageCallback.h + + djrQqQ5J0JGsXn7fyLOzs0g705Q= + + Headers/TextToImageManager.h + + f7vVMHfHHqbi4Bi4seJMqHn4wnU= + + Headers/TextToSpeechCallback.h + + Q6/osX2ZUFgH9dbRA17GNlOraXI= + + Headers/TextToSpeechManager.h + + /j5GzHn6HDrV0eCdlQiwGi65QEQ= + + Info.plist + + LYDkUlG3+K2ItUesIisY3Luuk1c= + + Modules/module.modulemap + + 0SW07sgC8aptSEw6560m065YdrY= + + PrivacyInfo.xcprivacy + + SRctDO3cqibONLEG7CPcNZVBnXw= + + + files2 + + Headers/AIGCErrorCode.h + + hash + + 6X+BFAl1GUlE673wijlbbmSDK7o= + + hash2 + + kB/hT+CxZkfSQW7qym0IydflbAkE3AYBvdij+bCDmlw= + + + Headers/StarbaustVoiceChatModel.h + + hash + + O8K7t0c5zyFzqsMRLB06Q9rMy98= + + hash2 + + Te3DhLKFm7g9Cqh68BOLUikve5gURqN9RWUPumoYzZY= + + + Headers/StarburstAsrConfig.h + + hash + + tSk0X4yTu1hQB88SVtxWkHcfTRY= + + hash2 + + EY1t77d6qelm3wi1yYEcG5Kw1HNnR8mziKSGBadmqOg= + + + Headers/StarburstAsrModel.h + + hash + + YMyp9i53bEO3diakJf+v5x2v2a0= + + hash2 + + r5bjhqHYbfX3MyhkjDOmAbqeXjuBI9fSoQRq/L0POEU= + + + Headers/StarburstConfig.h + + hash + + s3KYCCc8Cq0RWmlyfW7qe20T0c8= + + hash2 + + q5+7n+PJt+RNcfGHp6EMO49CqhiFTaqcIZQbeDtZcTk= + + + Headers/StarburstFileAsrModel.h + + hash + + KCay85nepjWFLxW32vUBaknoYTk= + + hash2 + + Y1+wOB3+K0CSFktnWVRMaxl9SsvQMDAZcFup9gudCFg= + + + Headers/StarburstOffLineFile.h + + hash + + 28IGQ1ND/MHAAnUNKNBxuvS5ROc= + + hash2 + + JqjH7qjguq8OEs3MklD/pyfD9ULJzpCwIyS37AvPIe8= + + + Headers/StarburstPhoneSdk.h + + hash + + rwT9UO4f4YJAdgYM9SUrQo6cW0M= + + hash2 + + kAdf5gAAX2xUk1XeiyxZjeGRvGhNe10TZexUz4PhxWU= + + + Headers/StarburstSdk.h + + hash + + aWY4JErrzMt9gCv0UqKyp5t+qGM= + + hash2 + + rnnCMlslMnwvphEZDLtWFp+XfQ1GqRFbhT7jnUVbBV4= + + + Headers/StarburstSdkManager.h + + hash + + qhZrrBq0fWMMexpfZdAUj4ZVVNg= + + hash2 + + J/65oVgQZfwUd8TWmGj/cvoeb7k9t79kPFQCeVGYRIQ= + + + Headers/StarburstStreamModel.h + + hash + + cdW3VKYRIjOHM5xn0Zzt3fioFro= + + hash2 + + XC3yJkUL3sL1YkFBUADx+q+Q47YB040DrB7QEhOJa7w= + + + Headers/StarbusrtSpeaker.h + + hash + + SBlLEersGuEueZNxVNc2uyepfts= + + hash2 + + yCNcI1umW3Pgn7rtgMv5kZTDZXr/QxvPNRoNjcIrTJU= + + + Headers/StartburstDecoderConfig.h + + hash + + CEyiYJhRwvumcRqNLLoJARHeU24= + + hash2 + + PlYBO1RRT96qRTFSidHUui8kpiVj0/pQW85jqIjCtzY= + + + Headers/StartburstGlassChat.h + + hash + + EKmAva0NghWkD5BgB3v2JyOqcQo= + + hash2 + + YIfvJ+AmQws0QANocYZxmOahypPKgbsEZXeR6wEInTA= + + + Headers/StartburstGlassesSdk.h + + hash + + zjj7I7WFlFcTzkseAMNaUZyEIyI= + + hash2 + + h+sX2xVUY3pWvU9949WQN6IoZau4WG4Ad1qRwJeC6Yk= + + + Headers/StartburstMixSdk.h + + hash + + CLg1FGxHPySPI5qCJH4N1zAZIw4= + + hash2 + + Z6H7+vUoMzMfpR9r7joECzicS9kOX4b/rqZb0fOMoaU= + + + Headers/TextToImageCallback.h + + hash + + djrQqQ5J0JGsXn7fyLOzs0g705Q= + + hash2 + + q/BtJzWpEpHfy9C5Bf07jUccilYQqgy94yGf3KLWwKM= + + + Headers/TextToImageManager.h + + hash + + f7vVMHfHHqbi4Bi4seJMqHn4wnU= + + hash2 + + N96kZDSkodLOSzvpZTi6amQVAYq0AzsFO6tvFFlQEoE= + + + Headers/TextToSpeechCallback.h + + hash + + Q6/osX2ZUFgH9dbRA17GNlOraXI= + + hash2 + + EXuN8dBBPFNJNuxSb0kaSfMs+i0WbS/9uA9tJ95RhlY= + + + Headers/TextToSpeechManager.h + + hash + + /j5GzHn6HDrV0eCdlQiwGi65QEQ= + + hash2 + + ikdltWnYn+xcIZztjJovnuoIDocq2Zwz81BLGh2HmZM= + + + Modules/module.modulemap + + hash + + 0SW07sgC8aptSEw6560m065YdrY= + + hash2 + + js/u3ymUzjIe0pCJDIjb2G3IBfLvIq7aILJo9tH8J8k= + + + PrivacyInfo.xcprivacy + + hash + + SRctDO3cqibONLEG7CPcNZVBnXw= + + hash2 + + cuaVRkQIQRl8fLAPRH2XlUdsPxO0W90uL0WcSHvmSnY= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ShenYin/StarburstSdk.framework/_CodeSignature/CodeSignature b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeSignature new file mode 100644 index 0000000..cf66e23 Binary files /dev/null and b/ShenYin/StarburstSdk.framework/_CodeSignature/CodeSignature differ