Browse Source

优化代码

newdev_shunjiawei
liwei1dao 1 year ago
parent
commit
f47590189e
  1. 4
      lib/modules/qqmusic/views/qqmusic_playlist_view.dart
  2. 6
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift
  3. 5
      local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureTtsHelper.swift

4
lib/modules/qqmusic/views/qqmusic_playlist_view.dart

@ -62,7 +62,7 @@ class QqmusicPlaylistView extends GetView<QQMusicPlaylistController> {
], ],
), ),
// 添加迷你播放器 // 添加迷你播放器
bottomNavigationBar: _buildMiniPlayer(isDarkMode), // bottomNavigationBar: _buildMiniPlayer(isDarkMode),
); );
} }
@ -113,7 +113,7 @@ class QqmusicPlaylistView extends GetView<QQMusicPlaylistController> {
_buildProgressBar(isDarkMode), _buildProgressBar(isDarkMode),
SizedBox(height: 15.h), SizedBox(height: 15.h),
// 播放控制按钮 // 播放控制按钮
// _buildPlayControls(isDarkMode), _buildPlayControls(isDarkMode),
], ],
), ),
); );

6
local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

@ -1508,7 +1508,7 @@ class AudioPlayer {
} }
func playStartSound() { func playStartSound() {
playSound(named: "start", fileType: "mp3") // playSound(named: "start", fileType: "mp3")
} }
func playAwaitSound() { func playAwaitSound() {
@ -1523,11 +1523,11 @@ class AudioPlayer {
} }
func playStopSound() { func playStopSound() {
playSound(named: "stop", fileType: "mp3") // playSound(named: "stop", fileType: "mp3")
} }
func playCallingSound() { func playCallingSound() {
playLoopSound(named: "calling", fileType: "mp3", player: &callingPlayer) // playLoopSound(named: "calling", fileType: "mp3", player: &callingPlayer)
} }
func stopCallingSound() { func stopCallingSound() {

5
local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureTtsHelper.swift

@ -525,6 +525,11 @@ public class AzureTtsHelper: NSObject, ITtsService {
cleaned = regex.stringByReplacingMatches(in: cleaned, range: NSRange(location: 0, length: cleaned.count), withTemplate: "") cleaned = regex.stringByReplacingMatches(in: cleaned, range: NSRange(location: 0, length: cleaned.count), withTemplate: "")
} }
// 移除标点符号
if let regex = try? NSRegularExpression(pattern: "[;:#;:*\\n]+", options: .caseInsensitive) {
cleaned = regex.stringByReplacingMatches(in: cleaned, range: NSRange(location: 0, length: cleaned.count), withTemplate: "")
}
// 合并空格 // 合并空格
if let regex = try? NSRegularExpression(pattern: "\\s+", options: .caseInsensitive) { if let regex = try? NSRegularExpression(pattern: "\\s+", options: .caseInsensitive) {
cleaned = regex.stringByReplacingMatches(in: cleaned, range: NSRange(location: 0, length: cleaned.count), withTemplate: " ") cleaned = regex.stringByReplacingMatches(in: cleaned, range: NSRange(location: 0, length: cleaned.count), withTemplate: " ")

Loading…
Cancel
Save