Iphone sounds for more than five seconds

Hello everybody. Below is the code that I use to play random sounds on the iPhone simulator. Some of the 30 or so sounds will not play, and after some research, I found out that those that didn't play lasted more than five seconds. Does anyone know why this is? Thanks in advance for your help!

NSString *path = [[NSBundle mainBundle] pathForResource:sound ofType:@"wav"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound (soundID);
+3
source share
2 answers

I believe that there is a limit of 5 seconds (although some versions of the documentation require 30 seconds) to play sound using AudioServicesPlaySystemSound.

- OpenAL Audio Queues. openAL: http://benbritten.com/blog/2008/11/06/openal-sound-on-the-iphone/

+3

iPhone Simulator, . AudioServicesPlaySystemSound 30 .

, / "" 5- . afconvert Apple.

+2

Source: https://habr.com/ru/post/1709441/


All Articles