【发布时间】:2013-06-26 11:23:51
【问题描述】:
以下问题:
<0xb03e7000> Error '!obj' trying to fetch default input device's sample rate
<0xb03e7000> Error getting audio input device sample rate: '!obj'
<0xb03e7000> AQMEIOManager::FindIOUnit: error '!dev'
我已经在 stackoverflow 上发现了这个问题,但没有一个 提供的解决方案对我有用。
代码:
#import "CJTActionViewController.h"
@interface CJTActionViewController()
@property NSURL *url;
@property NSData *songFile;
@property AVAudioPlayer *audioPlayer;
@end
@implementation CJTActionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.url = [NSURL fileURLWithPath: [NSString stringWithFormat:@"%@/cannon_01.wav", [[NSBundle mainBundle] resourcePath]]];
self.songFile = [[NSData alloc] initWithContentsOfURL:self.url];
self.audioPlayer = [[AVAudioPlayer alloc] initWithData:self.songFile error:nil];
self.audioPlayer.delegate = self;
self.audioPlayer.numberOfLoops = 0;
}
- (IBAction)firePressed(id):sender
{
[self.audioPlayer play];
}
@end
委托已设置。不知道它是否重要,但在另一台 Mac 上 代码运行没有问题。
我使用 ios 6.1 和模拟器 6.1
【问题讨论】:
标签: ios-simulator runtime-error avaudioplayer