ios - AVAudioSession properties after Initializing AUGraph -
to start call, our voip app sets avaudiosession, builds, initializes , runs augraph.
during call, allow user switch , forth between speakerphone mode using code such as:
avsession = [avaudiosession sharedinstance]; avaudiosessioncategoryoptions categoryoptions = [avsession categoryoptions]; categoryoptions |= avaudiosessioncategoryoptiondefaulttospeaker; nslog(@"audioservice:setspeaker:setproperty:defaulttospeaker=1 categoryoptions = %lx", (unsigned long)categoryoptions); bool success = [avsession setcategory:avaudiosessioncategoryplayandrecord withoptions:categoryoptions error:&error]; which works fine. if try avaudiosession queries after augraph has been initialized, example:
avaudiosessiondatasourcedescription *myinputdatasource = [avsession inputdatasource]; the result null. running same line of code before execute augraphinitialize gives correct non-null result. can explain going on here , how access avaudiosession properties/methods while using augraph?
this expected behavior per developer documentation, inputdatasource should return nil if not possible switch sources. apple not letting bad happen via mis-config, nil source can give wrong idea. hope helps.
discussion value of property nil if switching between multiple input sources not possible. feature supported on devices , peripherals–for example, on iphone equipped both front- , rear-facing microphones.
Comments
Post a Comment