- Timestamp:
- Jul 31, 2015 8:35:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m
r4883 r5142 335 335 } 336 336 #endif 337 338 /* Initialize audio session category and mode */ 339 { 340 AVAudioSession *sess = [AVAudioSession sharedInstance]; 341 pj_bool_t err; 342 343 if ([sess respondsToSelector:@selector(setCategory:withOptions:error:)]) 344 { 345 err = [sess setCategory:AVAudioSessionCategoryPlayAndRecord 346 withOptions:AVAudioSessionCategoryOptionAllowBluetooth 347 error:nil] != YES; 348 } else { 349 err = [sess setCategory:AVAudioSessionCategoryPlayAndRecord 350 error:nil] != YES; 351 } 352 if (err) { 353 PJ_LOG(3, (THIS_FILE, 354 "Warning: failed settting audio session category")); 355 } 356 357 if ([sess respondsToSelector:@selector(setMode:error:)] && 358 [sess setMode:AVAudioSessionModeVoiceChat error:nil] != YES) 359 { 360 PJ_LOG(3, (THIS_FILE, "Warning: failed settting audio mode")); 361 } 362 } 337 363 338 364 cf_instance = cf; … … 1237 1263 { 1238 1264 OSStatus ostatus; 1265 1239 1266 #if !COREAUDIO_MAC 1240 /* We want to be able to open playback and recording streams */1241 1267 strm->sess = [AVAudioSession sharedInstance]; 1242 if ([strm->sess setCategory:AVAudioSessionCategoryPlayAndRecord1243 error:nil] != YES)1244 {1245 PJ_LOG(4, (THIS_FILE,1246 "Warning: cannot set the audio session category"));1247 }1248 1268 #endif 1249 1269
Note: See TracChangeset
for help on using the changeset viewer.