在iPhone应用程序中播放/暂停声音

时间:2015-04-22 15:25:48

标签: ios audio

有没有办法停止播放音频?喜欢播放/停止的东西?

 -(IBAction)PlaySound:(id)sender{

audioTitle = [NSString stringWithFormat:@"Audio %@", audioInteger];
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLREF;
soundfileURLREF = CFBundleCopyResourceURL(mainBundle, (CFStringRef) audioTitle, CFSTR ("mp3"), NULL);
UInt32 SoundID;
AudioServicesCreateSystemSoundID(soundfileURLREF, &SoundID);
AudioServicesPlaySystemSound(SoundID);

}

0 个答案:

没有答案