简体   繁体   English

iOS系统声音服务无法调节音量

[英]iOS system sound service unable to adjust volume

in .h: 在.h中:

#import <AudioToolbox/AudioToolbox.h>
@interface ViewController : UIViewController {
    SystemSoundID beatAudio;
}

in.m: 英寸:

//File path already created
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &(beatAudio));
AudioServicesPlaySystemSound(beatAudio);

The sound is perfect, but when I toggle up and down the volume bar, the volume of this sound is not affected. 声音很完美,但是当我在音量栏上上下切换时,该声音的音量不会受到影响。 Any solutions? 有什么办法吗?

You've created it as a system sound, and in order for them to be affected by the volume control, you have to change the phone settings 您已将其创建为系统声音,并且为了使其受到音量控制的影响,您必须更改手机设置

Go into settings->sounds and select 'Change with Buttons' to on. 进入设置->声音,然后选择“使用按钮更改”为开。

You may not need to play this sound as a system sound though ? 您可能不需要将此声音作为系统声音播放吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM