简体   繁体   English

需要一些帮助,有人知道为什么系统声音在iPad上不起作用而在iPhone上起作用吗?

[英]Need some help, anyone know why system sound isn't working on iPad but is on iPhone?

I am working on an app for kids, and I am using short audio with the AVFoundation framework and AudioServicesCreateSystemSound. 我正在为孩子设计一个应用程序,并且正在将短音频与AVFoundation框架和AudioServicesCreateSystemSound一起使用。 The app works great with no issues on iPhone 3, 3G, 4, 4s. 该应用程序在iPhone 3、3G,4、4s上运行良好,没有任何问题。 However it isn't working on an iPad 2 ill put the code for playing the sound with, I'm just not sure if there is an issue with it on the iPad or what, it works fine in the simulator for the iPad but not on the actual device. 但是,它在iPad 2上不起作用,不适用于播放声音的代码,我只是不确定在iPad上是否存在问题,或者在iPad的模拟器中可以正常工作,但不能在实际设备上。 The code is below: 代码如下:

-(IBAction)soundcar {
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef soundFileURLRef;
    soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"auto", CFSTR("wav"), NULL);

    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
    AudioServicesPlaySystemSound(soundID);
}

anyone know what I can do to fix, it would be great or if it may be just an issue with the iPad itself I'm not sure. 任何人都知道我能做些什么来解决,这会很棒,或者我不确定iPad本身是否只是一个问题。 Anything that helps is appreciated. 任何有帮助的人都会感激不尽。

Stupid question I know, but the volume is not down on the device is it? 我知道这个愚蠢的问题,但是设备上的音量没有降低吗? You'd be amazed how many times we see this.... 您会惊讶我们看到多少次了。

我发现问题出在iPad和iPod上,铃声和警报音量默认设置为低设置,调高此音量可修复createSystemSound的音频音量输出。

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

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