diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 4ef33cfa7..d0bbc4669 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -11,8 +11,6 @@ PODS: - Flutter - classic_bluetooth (0.0.1): - Flutter - - device_info_plus (0.0.1): - - Flutter - FBAEMKit (18.0.0): - FBSDKCoreKit_Basics (= 18.0.0) - FBSDKCoreKit (18.0.0): @@ -44,6 +42,8 @@ PODS: - WechatOpenSDK-XCFramework (~> 2.0.4) - haptic_feedback (0.5.1): - Flutter + - keyboard_height_plugin (0.0.1): + - Flutter - libwebp (1.5.0): - libwebp/demux (= 1.5.0) - libwebp/mux (= 1.5.0) @@ -85,16 +85,17 @@ PODS: - SDWebImage/Core (~> 5.17) - spotify_sdk (0.0.1): - Flutter - - tencentcloud_cos_sdk_plugin (1.2.4): + - tencentcloud_cos_sdk_plugin (1.2.3): - Flutter - QCloudCOSXML (= 6.4.7) - WechatOpenSDK-XCFramework (2.0.4) + - wifi_iot (0.0.1): + - Flutter DEPENDENCIES: - amap_service (from `.symlinks/plugins/amap_service/ios`) - audio_waveforms (from `.symlinks/plugins/audio_waveforms/ios`) - classic_bluetooth (from `.symlinks/plugins/classic_bluetooth/ios`) - - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) - flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) - flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`) @@ -103,12 +104,14 @@ DEPENDENCIES: - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`) - haptic_feedback (from `.symlinks/plugins/haptic_feedback/ios`) + - keyboard_height_plugin (from `.symlinks/plugins/keyboard_height_plugin/ios`) - location_service (from `.symlinks/plugins/location_service/ios`) - ota (from `.symlinks/plugins/ota/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - record_darwin (from `.symlinks/plugins/record_darwin/ios`) - spotify_sdk (from `.symlinks/plugins/spotify_sdk/ios`) - tencentcloud_cos_sdk_plugin (from `.symlinks/plugins/tencentcloud_cos_sdk_plugin/ios`) + - wifi_iot (from `.symlinks/plugins/wifi_iot/ios`) SPEC REPOS: trunk: @@ -135,8 +138,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/audio_waveforms/ios" classic_bluetooth: :path: ".symlinks/plugins/classic_bluetooth/ios" - device_info_plus: - :path: ".symlinks/plugins/device_info_plus/ios" Flutter: :path: Flutter flutter_facebook_auth: @@ -153,6 +154,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/fluwx/ios" haptic_feedback: :path: ".symlinks/plugins/haptic_feedback/ios" + keyboard_height_plugin: + :path: ".symlinks/plugins/keyboard_height_plugin/ios" location_service: :path: ".symlinks/plugins/location_service/ios" ota: @@ -165,6 +168,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/spotify_sdk/ios" tencentcloud_cos_sdk_plugin: :path: ".symlinks/plugins/tencentcloud_cos_sdk_plugin/ios" + wifi_iot: + :path: ".symlinks/plugins/wifi_iot/ios" SPEC CHECKSUMS: amap_service: 1c3e7e07f51cbbdff03719a4a079c60d015c1c0b @@ -173,7 +178,6 @@ SPEC CHECKSUMS: AMapNavi: fceb4715f9a3b5a25f330facebee2aa2bdba42dd audio_waveforms: a6dde7fe7c0ea05f06ffbdb0f7c1b2b2ba6cedcf classic_bluetooth: c146e1618e867a47fa7ab79a3bf262e7d69d557d - device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896 FBAEMKit: e34530df538b8eb8aeb53c35867715ba6c63ef0c FBSDKCoreKit: d3f479a69127acebb1c6aad91c1a33907bcf6c2f FBSDKCoreKit_Basics: 017b6dc2a1862024815a8229e75661e627ac1e29 @@ -186,6 +190,7 @@ SPEC CHECKSUMS: flutter_tts: b88dbc8655d3dc961bc4a796e4e16a4cc1795833 fluwx: 6bf9c5a3a99ad31b0de137dd92370a0d10a60f4b haptic_feedback: fd1d8509833f58f164fc12122c0357fa9b2750e0 + keyboard_height_plugin: ef70a8181b29f27670e9e2450814ca6b6dc05b05 libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8 location_service: fab4ef23d473296a215c49e12c129e466574d94e Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d @@ -198,8 +203,9 @@ SPEC CHECKSUMS: SDWebImage: f84b0feeb08d2d11e6a9b843cb06d75ebf5b8868 SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 spotify_sdk: a48400bb29f70c4fe251ebfdc9135c37097ac5ca - tencentcloud_cos_sdk_plugin: 7bed564dbe72df23e7b5cacb1e51b1a20cb1639c + tencentcloud_cos_sdk_plugin: c3d78b2c3bae42b5a20009dc047f3f1621e6272b WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f + wifi_iot: f645260a2be8608517b2a9bf4c39b98e97003acc PODFILE CHECKSUM: 517ecd5ce5153c9609017e05f4e64ab72605e805 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bad551a70..4df97502d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -252,7 +252,7 @@ ); mainGroup = 97C146E51CF9000F007C117D; packageReferences = ( - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, D013B7972DFA83E400B2B69B /* XCRemoteSwiftPackageReference "flutterfire" */, ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; @@ -526,7 +526,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 42C82SZUVX; + DEVELOPMENT_TEAM = 537SFY28XS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 18.0; @@ -534,7 +534,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.yunqiinnovation.deepsound; + PRODUCT_BUNDLE_IDENTIFIER = com.chuangxiangyunqi.deapsound; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -716,7 +716,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 42C82SZUVX; + DEVELOPMENT_TEAM = 537SFY28XS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 18.0; @@ -724,7 +724,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.yunqiinnovation.deepsound; + PRODUCT_BUNDLE_IDENTIFIER = com.chuangxiangyunqi.deapsound; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -741,7 +741,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 42C82SZUVX; + DEVELOPMENT_TEAM = 537SFY28XS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 18.0; @@ -749,7 +749,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.yunqiinnovation.deepsound; + PRODUCT_BUNDLE_IDENTIFIER = com.chuangxiangyunqi.deapsound; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -793,7 +793,7 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { isa = XCLocalSwiftPackageReference; relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5be33da0e..bc3f4a793 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -39,7 +39,7 @@ - CFBundleVersion + CFBundleVersion $(FLUTTER_BUILD_NUMBER) FacebookAdvertiserIDCollectionEnabled diff --git a/lib/data/services/network/nw_api.dart b/lib/data/services/network/nw_api.dart index 9a60f66f3..8feff1db5 100644 --- a/lib/data/services/network/nw_api.dart +++ b/lib/data/services/network/nw_api.dart @@ -1,5 +1,5 @@ class NWApi { // static const baseApi = "https://www.deapsound.com"; - static const baseApi = "https://api.ideapsound.com"; + static const baseApi = "https://api.deapsound.com"; // static const baseApi = "https://api.ideapsound.com"; } diff --git a/local_plugins/music_service/ios/music_service/Sources/music_service/MusicService.swift b/local_plugins/music_service/ios/music_service/Sources/music_service/MusicService.swift index 45b830e4a..fd0382cae 100644 --- a/local_plugins/music_service/ios/music_service/Sources/music_service/MusicService.swift +++ b/local_plugins/music_service/ios/music_service/Sources/music_service/MusicService.swift @@ -4,6 +4,7 @@ // // Created by 李伟 on 2025/6/4. // +import Flutter import Foundation import AVFoundation import MediaPlayer diff --git a/local_plugins/realtime/ios/realtime/Sources/realtime/RealtimeAudioManager.swift b/local_plugins/realtime/ios/realtime/Sources/realtime/RealtimeAudioManager.swift index c2a9d424a..93a38fb84 100644 --- a/local_plugins/realtime/ios/realtime/Sources/realtime/RealtimeAudioManager.swift +++ b/local_plugins/realtime/ios/realtime/Sources/realtime/RealtimeAudioManager.swift @@ -324,21 +324,32 @@ class RealtimeAudioManager { } /// 计算音频缓冲区的RMS值 - private func calculateRMS(buffer: AVAudioPCMBuffer) -> Float { - guard let channelData = buffer.int16ChannelData?[0], - buffer.frameLength > 0 else { - return 0.0 - } - - let frameCount = Int(buffer.frameLength) - var rms: Float = 0.0 - - // 使用Accelerate框架高效计算RMS - vDSP_measqv(channelData, 1, &rms, vDSP_Length(frameCount)) - - // 计算平方根并归一化 - rms = sqrt(rms / Float(frameCount)) / 32768.0 - - return rms +private func calculateRMS(buffer: AVAudioPCMBuffer) -> Float { + guard let channelData = buffer.int16ChannelData?[0], + buffer.frameLength > 0 else { + return 0.0 } + + let frameCount = Int(buffer.frameLength) + let channelDataPointer = UnsafeMutablePointer(mutating: channelData) + + // 创建浮点缓冲区用于转换 + var floatData = [Float](repeating: 0.0, count: frameCount) + + // 1. 将16位整型转换为浮点型 + vDSP_vflt16(channelDataPointer, 1, &floatData, 1, vDSP_Length(frameCount)) + + // 2. 归一化到[-1.0, 1.0]范围 + var normalizedData = [Float](repeating: 0.0, count: frameCount) + var divisor: Float = 32768.0 + vDSP_vsdiv(floatData, 1, &divisor, &normalizedData, 1, vDSP_Length(frameCount)) + + // 3. 计算均方值 + var meanSquare: Float = 0.0 + vDSP_measqv(normalizedData, 1, &meanSquare, vDSP_Length(frameCount)) + + // 4. 计算RMS值 + let rms = sqrt(meanSquare) + return rms +} } \ No newline at end of file diff --git a/local_plugins/speech/ios/speech/Sources/speech/ITtsService.swift b/local_plugins/speech/ios/speech/Sources/speech/ITtsService.swift index 3f784bc20..72ada9274 100644 --- a/local_plugins/speech/ios/speech/Sources/speech/ITtsService.swift +++ b/local_plugins/speech/ios/speech/Sources/speech/ITtsService.swift @@ -13,6 +13,12 @@ import Foundation /** 合成取消 */ case synthesisCanceled + /** 播放开始 */ + case playbackStarted + + /** 播放完成 */ + case playbackCompleted + /** 发生错误 */ case error } @@ -144,4 +150,4 @@ import Foundation * @param listener 要移除的音频数据监听器 */ func removeAudioDataListener(_ listener: AudioDataListener) -} \ No newline at end of file +} diff --git a/pubspec.yaml b/pubspec.yaml index 32cdf99ff..437abdc1a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -99,8 +99,6 @@ dependencies: path: local_plugins/amap_service location_service: path: local_plugins/location_service - bytedance_speech: - path: local_plugins/bytedance_speech realtime: path: local_plugins/realtime jl_opus: