|
|
@ -206,7 +206,7 @@ import UIKit |
|
|
// 重新激活会话 |
|
|
// 重新激活会话 |
|
|
try audioSession.setActive(true, options: .notifyOthersOnDeactivation) |
|
|
try audioSession.setActive(true, options: .notifyOthersOnDeactivation) |
|
|
isActive = true |
|
|
isActive = true |
|
|
|
|
|
// 切换到扬声器 |
|
|
// 记录当前配置 |
|
|
// 记录当前配置 |
|
|
currentCategory = category |
|
|
currentCategory = category |
|
|
currentMode = mode |
|
|
currentMode = mode |
|
|
@ -319,6 +319,8 @@ import UIKit |
|
|
], |
|
|
], |
|
|
force: false // 是否强制重新配置 |
|
|
force: false // 是否强制重新配置 |
|
|
) |
|
|
) |
|
|
|
|
|
try audioSession.overrideOutputAudioPort(.speaker) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -516,6 +518,8 @@ import UIKit |
|
|
force: force // 是否强制重新配置 |
|
|
force: force // 是否强制重新配置 |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
try audioSession.overrideOutputAudioPort(.speaker) |
|
|
|
|
|
|
|
|
// 额外的优化配置 |
|
|
// 额外的优化配置 |
|
|
if configureAdditionalSettings { |
|
|
if configureAdditionalSettings { |
|
|
// 获取当前是否使用耳机 |
|
|
// 获取当前是否使用耳机 |
|
|
|