-1

Basically I'm trying to detect Mono Audio value is On/Off pragmatically in my swift based project.

I want to read Mono Audio value is On/Off in user setting.

So based on that value I will prompt user that your Mono Audio setting is off please enable it from Settings

And redirect user to Audio Settings.

Settings > General > Accessibility > Mono Audio

But I am not sure how to read this property.

I have checked AudioToolbox framework but there I haven't find any thing.

Audio toolbox

I tried in Accessibility framework but no luck.

var isAccessibilityElement: Bool { get set }

Any Idea or ref how to get this detail via code ?

CodeChanger
  • 7,953
  • 5
  • 49
  • 80

1 Answers1

2

Accessibility Framework contains a method:

static var isMonoAudioEnabled: Bool { get }

It returns a Boolean value indicating whether system audio is set to mono. Isn't that, what you are looking for?

mschmidt
  • 2,740
  • 4
  • 17
  • 31
  • Ya actually I fond that with `UIAccessibilityIsMonoAudioEnabled()` function same like you posted here. Thanks for your answer. but I have one more question here if you can help me on that ? – CodeChanger Mar 22 '19 at 12:48
  • Can I directly Jump to Settings->General->Accessibility to On/Off this setting with openURL() method ? – CodeChanger Mar 22 '19 at 12:49
  • I'm not 100% sure. I think jumps into Preferences App were possible in earlier versions of iOS but are currently discouraged by Apple. The only exception may be an App's own preferences screen. – mschmidt Mar 22 '19 at 13:09