2015-04-01 76 views
0

我試圖在OS X 10.10下使用IOBluetoothHandsFreeDevice實現藍牙免提配置文件。我可以連接並控制運行iOS 8.2的iPhone 6,而不會出現問題。IOBluetoothHandsFreeDevice音頻靜態

每個第一個嘗試撥打或接聽電話(或使用Siri)導致靜音噪音從手機傳輸到我的電腦而不是音頻。由於它與我期望聽到的聲音(例如鈴聲等)同步,因此靜音看起來並​​不完全是隨機的。然而,從我的Mac到我的iPhone的音頻非常清晰。

在初始靜態音頻呼叫之後,使用相同的連接進行另一個呼叫會產生50/50的結果,一半的呼​​叫是完美的,另一半是靜態的。

這裏的基本代碼:

IOBluetoothDevice* device = ...; 
_hfDevice = [[IOBluetoothHandsFreeDevice alloc] initWithDevice:device delegate:self]; 
uint32_t supportedFeatures = _hfDevice.supportedFeatures; 
supportedFeatures |= IOBluetoothHandsFreeDeviceFeatureEnhancedCallStatus; 
supportedFeatures |= IOBluetoothHandsFreeDeviceFeatureEnhancedCallControl; 
supportedFeatures |= IOBluetoothHandsFreeDeviceFeatureCLIPresentation; 
[_hfDevice setSupportedFeatures:supportedFeatures]; 
[_hfDevice connect]; 

// after connected delegate method... 

// dial a phone number 
const NSString* phoneNumber = @"..."; 
[_hfDevice dialNumber:phoneNumber]; 

// or activate siri 
const NSString* activateSiri = @"AT+BVRA=1"; 
[_hfDevice sendATCommand:activateSiri]; 

我希望我可能忽視的東西,但蘋果對他們的藍牙代碼文檔不包含任何實例創建免提應用。有沒有其他人有這種經驗?

回答

1

此問題已在更新至OS X