OSStatus status; /******** Number of input channels ***************/ UInt32 inputchannels; UInt32 sizeofdata= sizeof(inputchannels); //problematic: gives number of potential inputs, not number actually connected status= AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputNumberChannels,&sizeofdata,&inputchannels); [self checkStatus:status]; //prints statement 1 if OSStatus !=0 NSLog(@"Inputs %d \n",inputchannels); //prints statement 2
The above code leads to the output of OSStatus 560161140 (statement 1) ..... and Inputs 0 (statement 2).
Someone please help me find out why I get this error status, what it can cause and how to prevent it ........
source share