[英]Change iPhone volume without user interaction, is it possible?
You can't. 你不能 See this thread
看到这个线程
You have to remember that the iPhone is designed as phone first and a computer second. 您必须记住,iPhone首先被设计为手机,其次是计算机。 Since phones are emergency communication devices whose functioning can literally be a matter of life and death, any programing functionality that might interfere with phone function is restricted.
由于电话是应急通信设备,其功能从字面上看可能是生死攸关的问题,因此任何可能影响电话功能的编程功能都受到限制。 If a program could override the hardware volume settings it could cause a user to miss a critical call with possibly disastrous consequences.
如果程序可以覆盖硬件音量设置,则可能导致用户错过紧急呼叫,并可能造成灾难性后果。 No app needs volume control more than users need their phone.
没有比用户需要更多的手机需要音量控制了。
You can always adjust the output of your app's own sound. 您始终可以调整应用程序自身声音的输出。 The
AVAudioPlayer
for example has a volume setting. 例如,
AVAudioPlayer
具有音量设置。 You just can't control the volume of the hardware and other apps. 您只是无法控制硬件和其他应用程序的音量。
If you are using AVAudioPlayer to play your sounds, you can just set the volume property. 如果使用AVAudioPlayer播放声音,则只需设置volume属性。
If you are using AudioServicesPlaySystemSound , then you cant. 如果您正在使用AudioServicesPlaySystemSound ,则不能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.