AudioServicesPlaySystemSound在iphone5中无效

时间:2015-06-17 07:33:46

标签: ios audio

 #import <AudioToolbox/AudioToolbox.h>
 ....
 @property (assign,nonatomic)SystemSoundID soundId;
 ...
 -(IBAction)testSound:(id)sender {
     if (_soundId == 0 ) {
         NSString *path = [[NSBundle mainBundle] pathForResource:@"sound"    ofType:@"wav"];
         NSURL *soundUrl= [NSURL fileURLWithPath:path];
         AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundUrl, &_soundID);
     }
     AudioServicesPlaySystemSound(soundID);
 }

上面相同的代码适用于iphone6 plus,对于模拟器(iphone5,..)但不能用于iphone 5设备,有谁能说出原因? 感谢

0 个答案:

没有答案