|
|
|
@ -273,10 +273,10 @@ public class MusicService: NSObject { |
|
|
|
} |
|
|
|
|
|
|
|
/// 降低音量(AI说话时) |
|
|
|
func reduceVolume() { |
|
|
|
public func reduceVolume() { |
|
|
|
if !isVolumeReduced { |
|
|
|
originalVolume = currentVolume |
|
|
|
let reducedVolume = max(0.0, min(1.0, currentVolume * 0.3)) // 降低到30% |
|
|
|
let reducedVolume = max(0.0, min(1.0, currentVolume * 0.2)) // 降低到30% |
|
|
|
setVolume(volume: reducedVolume) |
|
|
|
isVolumeReduced = true |
|
|
|
print("AI说话开始,音量从 \(originalVolume) 降低到 \(reducedVolume)") |
|
|
|
@ -284,7 +284,7 @@ public class MusicService: NSObject { |
|
|
|
} |
|
|
|
|
|
|
|
/// 恢复原始音量(AI说话结束时) |
|
|
|
func restoreVolume() { |
|
|
|
public func restoreVolume() { |
|
|
|
if isVolumeReduced { |
|
|
|
setVolume(volume: originalVolume) |
|
|
|
isVolumeReduced = false |
|
|
|
|