How to determine the sound balance left / right?

I am trying to automatically determine the left / right balance of the audio, and there seems to be no api to get the value of this parameter. I managed to find a way to UIAccessibilityIsMonoAudioEnabled() to detect if the user turned on monaural sound, but I can not find an equivalent function for sound balance.

Does anyone know how I can do this?

PS Go to “Settings” - “Basic” - “Accessibility”, and then scroll down to “Listen” to set these parameters.

+6
source share
2 answers

I am sure this is not an acceptable answer, but ...

After looking at the various APIs, I think my conclusion is: Impossible .

There is no direct API that reads this particular setting. There is also no way to read the value directly - since it is stored outside the sandbox of your application.

My best suggestion is to submit a feature request to the Apples Bug Reporter .

+5
source

I'm not sure, but it looked as if it could help.

 struct AudioBalanceFade { Float32 mLeftRightBalance; Float32 mBackFrontFade; UInt32 mType; const AudioChannelLayout *mChannelLayout; }; typedef struct AudioBalanceFade AudioBalanceFade; 

Documentation (link)

or

 - (float)peakPowerForChannel:(NSUInteger)channelNumber 
+1
source

Source: https://habr.com/ru/post/949129/


All Articles