gpt4 book ai didi

iphone - 音频将在 iPhone 模拟器中播放,但不会在设备上播放

转载 作者:行者123 更新时间:2023-12-03 21:07:47 25 4
gpt4 key购买 nike

基本上,当触摸我的应用程序上的按钮时,就会播放音频。足够简单,但它无法在我的实际设备上运行,但在模拟器中运行良好。当触摸按钮时,执行此函数:

- (IBAction)playButtonSound
{
SystemSoundID buttonSound;
NSURL *tapSound = [[NSBundle mainBundle] URLForResource: @"Button_Sound" withExtension: @"caf"];
CFURLRef buttonSoundURLRef = (CFURLRef) [tapSound retain];
AudioServicesCreateSystemSoundID (buttonSoundURLRef, &buttonSound);
AudioServicesPlaySystemSound(buttonSound);
[tapSound release];
}

我还是一个 iPhone 新手,所以我不完全确定这是什么原因。

最佳答案

Make sure you write the correct file names, iOS is case sensitive, simulator is not.

关于iphone - 音频将在 iPhone 模拟器中播放,但不会在设备上播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5560717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com