簡體   English   中英

音頻文件可在iOS模擬器中運行,但無法在實際設備上找到

[英]Audio files working in iOS simulator, but can't be found on actual device

當我運行在iOS模擬器中播放聲音的應用程序時,它可以完美運行。 但是,當我在實際設備上運行它時,出現以下錯誤:

2015-04-20 21:44:00.173 Practical11-1 [230:7753] PAEAudioFilePlayer路徑:/private/var/mobile/Containers/Bundle/Application/D9E12F4A-88F6-41FC-9A0D-A195A56285DF/Practical11-1.app/找不到聲音/rain.aif

我正在使用的代碼來獲取文件是:

// An array of all available sounds
self.filenames = @[@"rain.aif",
                   @"storm.aif",
                   @"seaside.aif",
                   @"fire.aif",
                   @"nighttime.aif",
                   @"whitenoise.aif"];

接着:

 if (index < 0 || index >= self.activeFilenames.count)
    return;

// use the file name at the index to create the path
NSString* bundlePath = [@"sounds"stringByAppendingPathComponent:self.activeFilenames[index]];

有人有什么想法嗎?

在將聲音文件以大寫字母保存在項目中並在項目中以小寫字母引用時,我遇到過這個問題。 即:

項目中的文件= Rain.aif項目中的文件= rain.aif

模擬器將能夠解釋資源並找到正確的資源,但是由於區分大小寫,設備將發生故障。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM