Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

How to control “the system audio volume” of iOS

Author: h.mohri

Use C++Builder 10.2 to control audio volume of iOS.
I used the MPVolumeView class of iOS.
The MPVolumeView class is declared in “iOSapi.MediaPlayer.hpp”.

Include two files.

[crayon-68d01fc2a70a8305778816/]

Form design

Arrange “Up” and “Down” two TButton. Use this button to control the volume.

Add MPVolumeView to the main form Class

Add “_di_MPVolumeView” and “_di_UISlider” to the form class.

[crayon-68d01fc2a70ac498986315/]

Main Form constructor

[crayon-68d01fc2a70ae079615868/]

Code of volume down button

[crayon-68d01fc2a70af412815824/]

Code of volume up button

[crayon-68d01fc2a70b0638098793/]

Execute the program.

With Rad’s Studio Native Ios App builder, you can make apps on macOS & Ios in the Delphi or C++ environments. Try the free tool here.
Exit mobile version