1
ur(無線アプリ)からストリームを受信したiOSアプリ 一度iPhoneから外部スピーカーやカーオーディオシステムのようにBluetoothデバイスを使用してストリーミングしようとすると、バーテンは貧弱でびっくりします。 iOSデバイスから再生すると、すべてがうまく聞こえます(スピーカーとイヤホン)。iOS Swift - Bluetooth外部スピーカーを使用しているときに音質が悪い
override func viewDidLoad() {
super.viewDidLoad()
// Set AVFoundation category, required for background audio
var error: NSError?
var success: Bool
do {
try AVAudioSession.sharedInstance().setCategory(
AVAudioSessionCategoryPlayAndRecord,
withOptions: [
AVAudioSessionCategoryOptions.AllowBluetooth,
AVAudioSessionCategoryOptions.DefaultToSpeaker])
success = true
} catch let error1 as NSError {
error = error1
success = false
}
if !success {
print("Failed to set audio session category. Error: \(error)")
}