【发布时间】:2014-06-30 17:14:27
【问题描述】:
我有一个录音应用。我遇到了一个问题,当我打开我的应用程序并且手机与蓝牙设备配对时,一旦我开始录制,蓝牙设备就会认为我正在拨打电话。它会发出呼出的声音,并在屏幕上显示“ON CALL”(总是在谈论 BT 设备),但当然没有实际通话。
这就是我当前初始化会话的方式:
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideNone
error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionMixWithOthers |
AVAudioSessionCategoryOptionAllowBluetooth
error: nil];
我在 2 种不同的蓝牙设备上进行了尝试,类似的结果发生在相同的设备上。两者都尝试建立电话联系。
查看蓝牙日志后,我发现了一些关于它在做什么的线索:
12:24:07.185 A2DPClient.cpp:390 StopStreaming A2DP Notice Stopping A2DP audio streaming
12:24:07.186 A2DPClient.cpp:415 StopStreaming A2DP Notice Sending 'A2DP audio disconnected' event for device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.201 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 2
12:24:07.203 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 4
12:24:07.203 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 1
12:24:07.203 HandsfreeGateway.cpp:699 createVisualVoicemai Handsfree Notice Setting up virtual call
12:24:07.205 AudioSendThread.cpp:91 run Audio Notice AudioSendThread stopping
12:24:07.207 HandsfreeGateway.cpp:1540 initiateScoConnectio Handsfree Notice Initiating SCO connection with delay of 20 milliseconds
12:24:07.207 HandsfreeGateway.cpp:3179 handleUpdateCallStat Handsfree Notice Updating call status for call(s): [ [#1: Outgoing to +XXXXXXXXXXXXX "My Number" (voicemail)] ]
12:24:07.207 HandsfreeGateway.cpp:1523 delayScoConnection Handsfree Notice Delaying SCO connection by 20 milliseconds
12:24:07.208 HandsfreeGateway.cpp:3183 handleUpdateCallStat Handsfree Notice callPresent: no, callState: 1, callSetup: outgoing, heldStatus: none, heldChanged: no, visualVoicemail: yes
12:24:07.208 HandsfreeGateway.cpp:2871 tellEveryOneAboutVVM Handsfree Notice Sending call setup "outgoing" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.208 HandsfreeGateway.cpp:2877 tellEveryOneAboutVVM Handsfree Notice Sending call status "call active" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.208 HandsfreeGateway.cpp:2760 operator() Handsfree Notice Sending call setup "none" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.229 HandsfreeGateway.cpp:1626 internalConnectAudio Handsfree Notice Making outgoing audio connection to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.457 HandsfreeGateway.cpp:1161 audioEvent Handsfree Notice Received audio connected event for device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.471 A2DPClient.cpp:1384 SuspendCfm A2DP Notice Successfully suspended stream to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:25:36.959 LeObserver.cpp:904 scanTimer Discovery Notice Session "wirelessproxd-central-35-1" is now at scan level 3
12:25:59.599 HandsfreeAudioPlugIn.cpp:1050 audioPauseNotificati Handsfree Notice HandsfreeGateway::audioPauseNotification
12:25:59.599 HandsfreeGateway.cpp:726 deleteVisualVoicemai Handsfree Notice Cleaning up virtual call
12:25:59.599 HandsfreeGateway.cpp:1567 internalDisconnectAu Handsfree Notice Disconnecting audio from device 00:19:B5:FE:05:9B "VW_RADIO_55"
什么是设置虚拟通话???那时我在代码中唯一做的就是
[self.audioRecorder record];
self.audioRecorder 当然是AVAudioRecorder 的一个实例。
我怎样才能防止这种情况发生?
【问题讨论】:
标签: ios bluetooth avaudiorecorder avaudiosession