내 앱에 * .wav 파일을 미리로드하려면 크기가 크기 때문에 필요합니다. viewcontroller1
에서로드를 시작한 다음 viewcontroller15
에서 재생하고 싶습니다. 미리로드하는 코드가 필요합니다. 그것을 재생하기위한 코드는 다음과 같습니다 :오디오 파일 xcode를 미리로드하는 방법
CFBundleRef mainbundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef =CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"america", CFSTR ("wav"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
큰 오디오 파일을 버퍼링하고 재생할 수있는 간단한 iPhone 앱을 만들었습니다. 희망이 당신을 유용하게 찾을 수 있습니다. https://github.com/iitotoro/BufferedAudioPlayer – Totoro